4
votes

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.

1
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 naveensrinivasan.com/2010/05/14/…Naveen
Thanks Naveen. Your article got me this far :) Was just hoping to move one step past in eliminating that second window.Taylor Bird

1 Answers

4
votes

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.