简体   繁体   English

如何在交互式Powershell Remoting会话中使用cdb.exe

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

I am using cdb.exe to debug a service remotely. 我正在使用cdb.exe远程调试服务。 To ease this, I've been trying to use a powershell remoting session to do the work. 为了简化这一点,我一直在尝试使用powershell远程会话来完成工作。 However, I am running into behavior I don't understand. 但是,我遇到了我不理解的行为。

This works 这有效

  1. new-pssession | new-pssession | enter-pssession 进入-的PSSession
  2. (in the interactive session) cdb.exe -server "npipe:pipe=debug" -p ### (在交互式会话中) cdb.exe -server“npipe:pipe = debug”-p ###
  3. (in another local powershell or cmd) cdb.exe -remote "npipe:pipe=debug,server=server" (在另一个本地PowerShell或cmd中) cdb.exe -remote“npipe:pipe = debug,server = server”

With that, I control the session remotely from my local cdb. 有了它,我从本地cdb远程控制会话。 I also see the entire session remotely in the connected remote powershell. 我还在连接的远程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. 这让我想到......为了快速会话,为什么不删除第二个本地窗口的需要,只需使用远程会话中的cdb。

Except, I can't get that to work. 除此之外,我无法让它发挥作用。

This doesn't work 这不起作用

  1. new-pssession | new-pssession | enter-pssesion 进入-pssesion
  2. (in the interactive session) cdb.exe -p ### (在交互式会话中) cdb.exe -p ###

The moment cdb reaches a point whre it prompts, powershell exits cdb and gives me the powershell prompt. 当cdb达到它提示的那一刻,powershell退出cdb并给我powershell提示符。

Is this a setting I can change? 这是我可以改变的设置吗?
Is this just something w/ how powershell remoting and WinRM work? 这只是PowerShell远程处理和WinRM工作的原因吗?

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. 任何类型的交互式CLI工具可能无法在远程会话中工作,或者至少非常好。 In a remote session PowerShell serializes what happens on the remote end and sends it back over the wire to the local session. 在远程会话中,PowerShell序列化远程端发生的事情,并通过线路将其发送回本地会话。 When you use PowerShell cmdlets, you get objects which PowerShell can handle. 使用PowerShell cmdlet时,可以获得PowerShell可以处理的对象。 CLI tools are going to return strings. CLI工具将返回字符串。 I don't think PowerShell remoting is going to help you here. 我认为PowerShell远程控制不会对你有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Powershell:调用调试分析器 cdb.exe 作为进程 - Powershell: Call Debug Analyzer cdb.exe as Process 如何在远程会话中执行字符串形式的PowerShell,而不是ScriptBlock? - How can I execute a block of PowerShell in a remoting session that is a string, and not a ScriptBlock? 如何通过Powershell Remoting运行7za.exe? - How can I get 7za.exe to run via Powershell Remoting? 如何在PowerShell Remoting会话的提示符下为计算机名称添加颜色? - How can I add color to the machine name in the prompt of a PowerShell Remoting session? 如何在powershell远程会话(powershell)中编辑文件 - how to edit a file in powershell remoting session (powershell) 如何将嵌入式PowerShell运行空间公开给远程处理 - How can I expose an embedded PowerShell runspace to remoting 我们是否需要在Powershell框架中使用瞬态远程会话? - Do we need to use transient remoting session in powershell framework? 如何使用 powershell 获取具有交互式登录权限的服务帐户列表? - How can I use powershell to get a list of service accounts with interactive logon privileges? Powershell远程处理-无法以其他用户身份执行exe - Powershell remoting - cannot execute an exe as another user 如何关闭每个交互式PowerShell会话? - How to close every interactive PowerShell session?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM