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.