dwchan
Enthusiast
Enthusiast

is there a default timeout with copy-VMGuestFile?

I am using the Copy-VMGuestFile to transfer files from my jump box to my newly provision VM as part of the post-installation process.  Everything seems to work but it will timeout while files are still being copy over to the destination (VM)

if ($StrVMDRole -ne 'Standard') {
My-Logger "Copy configuration files to VM $strVMName..."
$PrepDirectory = "New-Item -Path C:\$strVMPrepDir -ItemType directory -Force"
Invoke-VMScript -ScriptText $PrepDirectory -VM $strVMName -GuestCredential $DCLocalCredential
Copy-VMGuestFile -Source "$PostIntallationRepo\$strVMPrepDir\*" -Destination "C:\$strVMPrepDir" -VM $strVMName -LocalToGuest -GuestCredential $DCLocalCredential
}

In my case, Invoke-VMScript was able to connect and create the proper directory structure on the VM, and the COpy-VMGuestFile actually transferred all of my smaller files over to the VM without issue.  It is with the bigger .exe that it copied only like 30 MB and stop.  Just curious if this is the default behavior or I need to put something else in the code to avoid some timeout I am not aware of

0 Kudos
2 Replies
LucD
Leadership
Leadership

The default timeout is 300 seconds afaik.
Did you try increasing that with the WebOperationTimeoutSeconds parameter on the Set-PowerCliConfiguration cmdlet?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
dwchan
Enthusiast
Enthusiast

Perfect, thanks for the tip.  Now that I know the default behavior I will give that setting a try.  Stay tune

0 Kudos