4

I am using cdb.exe to debug a service remotely. To ease this, I've been trying to use a powershell remoting session to do the work. However, I am running into behavior I don't understand.

This works

  1. new-pssession | enter-pssession
  2. (in the interactive session) cdb.exe -server "npipe:pipe=debug" -p ###
  3. (in another local powershell or cmd) cdb.exe -remote "npipe:pipe=debug,server=server"

With that, I control the session remotely from my local cdb. I also see the entire session remotely in the connected remote powershell. That leads me to think ... for a quick session, why not remove the need for that second local window, and just use cdb from the remote session.

Except, I can't get that to work.

This doesn't work

  1. new-pssession | enter-pssesion
  2. (in the interactive session) cdb.exe -p ###

The moment cdb reaches a point whre it prompts, powershell exits cdb and gives me the powershell prompt.

Is this a setting I can change?
Is this just something w/ how powershell remoting and WinRM work?

Seems odd that I can watch this entire session live in the remote window, but there is no way to interact with the same.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
Taylor Bird
  • 7,767
  • 1
  • 25
  • 31
  • 2
    I did something similar a while back. I don't remember the exact details. Here is the post I wrote, don't know if this would be helpful http://naveensrinivasan.com/2010/05/14/remote-debugging-with-windbg-and-powershell-remoting/ – Naveen Feb 03 '12 at 14:15
  • Thanks Naveen. Your article got me this far :) Was just hoping to move one step past in eliminating that second window. – Taylor Bird Feb 08 '12 at 17:12

1 Answers1

4

Any sort of interactive CLI tool probably won't work in a remoting session or at least very well. In a remote session PowerShell serializes what happens on the remote end and sends it back over the wire to the local session. When you use PowerShell cmdlets, you get objects which PowerShell can handle. CLI tools are going to return strings. I don't think PowerShell remoting is going to help you here.

Jeffery Hicks
  • 947
  • 5
  • 8
  • +1: even in v3, remoting is poor replacement for telnet. It's not really the targetted use cases, but it's impossible to not make these assumptions given the long history of interactive remote consoles like ssh, telnet etc on other platforms. It looks like duck, talks like a duck but limps like a two legged hippo and it's not a duck. – x0n Feb 06 '12 at 17:54
  • Telnet and PowerShell remoting are apples and oranges. If you need legacy support then telnet/ssh is the way to go. But if you want to leverage everything PowerShell can do with objects in a pipeline and all the rest, then there's nothing wrong with PowerShell remoting. It comes down to what you expect to accomplish from a shell interface. – Jeffery Hicks Feb 06 '12 at 23:40
  • @Jeffrey in the general terms, yes, but with respect to the context of the question (interactive CLI) then it's valid - it doesn't really matter whether its strings or not coming out of the remote apps, it's the fact that the remoting stream is as dumb a terminal as you can get. – x0n Feb 07 '12 at 02:01
  • Thanks, that's exactly what I assumed, just was hoping wasn't the answer. I'd love to see PSH with ssh abilities, but completely understand why it doesn't and would hate to lose the object-focused shell just to gain. Just would love to have one tool to rule them all especially as we move into Windows Server 8. – Taylor Bird Feb 08 '12 at 17:11