VMware Cloud Community
Muhammedali
Contributor
Contributor

Copy-VMGuestFile using it to copy multiple files from local to guest

In order to copy single file from local to guest

i used

E: on my local machine

C: on my guest VM

Copy-VMGuestFile -Source E:\Temp\Test.zip -Destination c:\Files\Testing  -VM MY_WinXP -LocalToGuest -GuestUser user -GuestPassword guest

for it works well.

however i tried to copy a folder with sub folders and files from local to guest machine using

Copy-VMGuestFile -Source E:\Temp\ -Destination c:\Files\Testing  -VM MY_WinXP -LocalToGuest -GuestUser user -GuestPassword guest

and it fails

Any explanations?

Can i use the above command to copy files from (Datastore of VMServer) to  the VM guest ??

Tags (1)
Reply
0 Kudos
3 Replies
admin
Immortal
Immortal

Hi there,

Currently Copy-VMGuestFile can copy single files only. We have plan in some future release to enhance the commandlet , to be capable to copy recursively folders.

And it is not possible to copy files with single commandlet from datastore to guest OS. You should use the combination of Copy-DatastoreItem and Copy-VMGuestFile

Vitali

PowerCLI Team

Muhammedali
Contributor
Contributor

Hi Vitali,

Since this morning i was using the

Copy-VMGuestFile -Source $BuildSource_BHMTest -Destination $VM_Destination -VM $VMName -LocalToGuest -GuestUser user  -GuestPassword user1

to copy files from my local machine to the VM

it was working well

however we had some a/c problem in the server rooms and the VM machines shut down due to rise in temperature.

After the a/c systems were working all the VM were working

I cud connect to the Vmsever using Vsphere client as well as powerCLI script.

The PCLi script for switchin on a vm, power on, revert snapshot are all working

however when i try to use

Copy-VMGuestFile -Source $BuildSource_BHMTest -Destination $VM_Destination -VM $VMName -LocalToGuest -GuestUser user  -GuestPassword user1

i'm having the followin error as show in attachment.

Need urgent help on this..

Reply
0 Kudos
admin
Immortal
Immortal

Hi,

Copy-VMGuestFile has parameter ToolsWaitSecs - you can define how many seconds the commandlet should wait the tools to become in running state before aborting the command. The default value is 20 seconds. Try to specify for example 60 seconds.

Vitali

PowerCLI Team

Reply
0 Kudos