Push-runspace 发生了什么以及替代品是什么?
至少在某些 PowerShell v2 CTP 中,有一个名为“push-runspace”的 cmdlet,(据我所知)它允许您获取本质上运行远程 PowerShell 的本地窗口。但是,此 cmdlet 以及所有 *-runspace cmdlet 并不存在于 PowerShell v2 中。我能看到的关于此类功能的唯一提及是:
PS> $host
Name : ConsoleHost
Version : 2.0
InstanceId : 054f6547-8729-417f-a560-bf046fbadc65
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
请注意 IsRunspacePushed
属性。由此看来,这种事情还是有可能的,但是我该怎么做呢?
In at least some of the PowerShell v2 CTPs, there was a cmdlet known as "push-runspace" which (I'm told) allowed you to get what was essentially a local window running a remote PowerShell. This cmdlet, however, and all of the *-runspace ones, are not present in PowerShell v2. The only mention I can see of this sort of functionality is this:
PS> $host
Name : ConsoleHost
Version : 2.0
InstanceId : 054f6547-8729-417f-a560-bf046fbadc65
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Note the IsRunspacePushed
property. From this I assume that this sort of thing is still possible, but how would I go about doing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番有根据的猜测后,答案是
enter-pssession
cmdlet。它创建与远程计算机的交互式会话。命令
get-help about_remoting
将为您提供所有令人讨厌的详细信息。The answer, after some educated guessing, is the
enter-pssession
cmdlet. It creates interactive sessions with remote machines.the command
get-help about_remoting
will give you all the nasty details.