Enter-PSSession:无法将类型为“ System.String”的对象转换为类型为“ VMState”的对象

问题描述

Enter-PSSession或Invoke-Command(从主机到Hyper v vm远程)在Powershell 7中不起作用。

Powershell 7:

PS C:\Users\*********> Enter-PSSession -VMName "something"

cmdlet Enter-PSSession at command pipeline position 1
Supply values for the following parameters:
Credential
User: ***********
Password for user ***************: ********************

Enter-PSSession: Unable to cast object of type 'System.String' to type 'VMState'.

Powershell 5: 相同的命令无缝运行

此外,我在Microsoft文档中找不到任何语法更改。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)