简体   繁体   中英

Invoke-vmscript fails to execute with unexpected error occurred on a receieve

Running below command on linux machine and it fails with below error:

Invoke-VMScript <<<<  -VM $machine.Name -ScriptType Bash -GuestUser $UserName -GuestPassword $Password -ScriptText $cmd -ToolsWaitSecs 400

Error:

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

Disconnect and connect back to VI server, this should fix the problem. Disconnect-VIServer -Server * -Confirm:$false -Force Connect-VIServer -Server $vcIP -Protocol https -User $vcUser -Password $vcPW

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM