How to use cdb.exe in a Powershell interactive remote access session

I am using cdb.exe to debug the service remotely. To facilitate this, I tried to use the powershell remote access session to do this work. However, I encounter behavior that I do not understand.

It works

  • new-pssession | Enter-pssession
  • (in an interactive session) cdb.exe -server "npipe: pipe = debug" -p ###
  • (in another local powershell or cmd) cdb.exe -remote "npipe: pipe = debug, server = server"

With this, I remotely control the session from my local cdb. I also see the entire session remotely in a connected remote PowerShell. It makes me think ... for a quick session, why not remove the need for this second local window and just use cdb from the remote session.

Also, I can't get this to work.

This does not work

  • new-pssession | enter-pssesion
  • (in an interactive session) cdb.exe -p ###

The cdb moment reaches the point it is requesting, powershell exits cdb and gives me a powershell hint.

Can I change the setting? Is this something that works with PowerShell and WinRM?

It seems strange that I can watch this entire session in a remote window, but there is no way to interact with it.

+4
source share
1 answer

Any interactive CLI tool will probably not work in a remote session, or at least very well. In a remote session, PowerShell serializes what happens at the remote end and sends it back through the wiring to the local session. When you use PowerShell cmdlets, you get objects that PowerShell can handle. CLI tools return strings. I don't think PowerShell will delete you here.

+4
source

Source: https://habr.com/ru/post/1394448/


All Articles