Invoke-vmscript无法执行,并在接收时发生意外错误

时间:2015-03-12 16:39:32

标签: powershell vmware powercli

在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

1 个答案:

答案 0 :(得分:1)

断开并连接回VI服务器,这应解决问题。 Disconnect-VIServer -Server * -Confirm:$ false -Force Connect-VIServer -Server $ vcIP -Protocol https -User $ vcUser -Password $ vcPW

相关问题