Push-runspace 发生了什么以及替代品是什么?

发布于 2024-10-01 16:17:44 字数 700 浏览 0 评论 0原文

至少在某些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半岛未凉 2024-10-08 16:17:44

经过一番有根据的猜测后,答案是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文