在linux机器上运行以下命令,它失败并出现以下错误:
Invoke-VMScript <<<< -VM $machine.Name -ScriptType Bash -GuestUser $UserName -GuestPassword $Password -ScriptText $cmd -ToolsWaitSecs 400
错误:
Invoke-VMScript The underlying connection was closed: An unexpected error occurred on a receive.
+ CategoryInfo : NotSpecified: (:) [Invoke-VMScript], ViError
+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_DownloadFileFromGuest_DownloadError,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript
答案 0 :(得分:1)
断开并连接回VI服务器,这应解决问题。 Disconnect-VIServer -Server * -Confirm:$ false -Force Connect-VIServer -Server $ vcIP -Protocol https -User $ vcUser -Password $ vcPW