我正在使用
Invoke-Command
在 VM 上运行几个命令。 VM 正在运行 Windows Server 2019。相同的命令在 Windows Server 2022 上不会失败。
这是我正在远程执行的代码。
$wu = New-Object -ComObject Microsoft.Update.ServiceManager -Strict
$ser = $wu.AddService2('7971f918-a847-4430-9279-4a52d1efe18d', 7, '')
紧接着,我得到这个错误:
Error: The background process reported an error with the following message: "The Hyper-V socket target process has ended.".
为什么这些命令中的任何一个都会中断 Hyper-V 套接字?