Copy-VMGuestFile : 4/11/2012 1:15:54 PMÂ Â Â Copy-VMGuestFileÂ Â Â Â Â Â Â While performing operation ‘Connect to host service
‘https://xyz/sdk’ at port 902′ the following error occured: ‘Failed to resolve host’
At line:1 char:17
+ Copy-VMGuestFile <<<<Â -LocalToGuest -Source C:\file1.txt -Destination c:\ -VM vmtest01 -GuestUser Administrator -GuestPassword “password”
+ CategoryInfoÂ Â Â Â Â Â Â Â Â : OperationStopped: (:) [Copy-VMGuestFile], VimException
+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_VixWaitForJob_VixError,VMware.VimAutomation.ViCore.Cmdlets.C
I got that error while trying to upload a file to a VM. I was connected to vc using it’s name vc01. When i have disconnected and connected again this time using FQDN vc01.mydomain.local it worked. So the reason while it was failing is because i was not connecting using FQDN of the VC server.
What is worth mentioning, in order to run cmdlets like copy-vmguestfile, make sure you are running powershell in 32bit, as it will not work under 64bit.