简体   繁体   中英

How can I use cdb.exe in an interactive Powershell Remoting session

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM