【发布时间】:2015-12-05 10:56:50
【问题描述】:
当目标运行 WMF 5.0(4 月预览版或 8 月预发布版)时,我在尝试使用 Invoke-Command 或 Enter-PSSession 时遇到了一个奇怪的错误。
我无法在 Google 上找到对此的任何参考,因此我怀疑这是本地/网络配置问题,但我不确定如何找到它。
有问题的帐户在两台机器上都具有本地管理员权限(在两台机器上都添加了域组),我可以在本地运行目标上的任何和所有命令。相反方向的远程访问会导致相同的错误(同样运行 5.0.10514)。
--- 输出可识别信息和格式调整以更好地包装---
# user@HOST | [2015-09-09 Wed 08:18]
C:\Windows>invoke-command -computer test {$psversiontable.psversion}
Major Minor Build Revision PSComputerName
----- ----- ----- -------- --------------
4 0 -1 -1 test
# user@HOST | [2015-09-09 Wed 08:18]
C:\Windows>enter-pssession -computer test
[test]: PS C:\Users\user\Documents> exit
# user@HOST | [2015-09-09 Wed 08:19]
C:\Windows>invoke-command -computer test {$psversiontable.psversion}
Major Minor Build Revision PSComputerName
----- ----- ----- -------- --------------
5 0 10514 6 test
# user@HOST | [2015-09-09 Wed 08:37]
C:\Windows>enter-pssession -computer test
enter-pssession : The term 'Measure-Object' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ enter-pssession -computer test
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Measure-Object:String) [Enter-PSSession],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
# user@HOST | [2015-09-09 Wed 08:38]
C:\Windows>
【问题讨论】:
标签: powershell powershell-remoting powershell-5.0