首页 > 解决方案 > PowershellCore 连接到 Powershell 5.1 远程计算机?

问题描述

我想知道是否可以从仅安装了 Powershell 5.1 的主机上的 Powershell 6/7 主机启动远程会话(这样我可以访问一些无法迁移到 Powershell 6/7 的 Powershell 5.1 功能) ?

问候,

标签: powershellpowershell-remotingpowershell-5.0powershell-core

解决方案


例如,要在远程计算机上显式定位Windows PowerShell
-ConfigurationName Microsoft.Powershell会话(版本最高为 v5.1),请使用with Invoke-Command

事实上,从 PowerShell 7.1 开始,这仍然是 PowerShell 远程命令所针对的默认版本,这反映在首选项变量$PSSessionConfigurationName中。

有关更多信息,请参阅此帖子


推荐阅读