| Name | Description | Required? | Pipeline Input | Default Value |
|---|
| Source | Specify the file you want to copy. If the file is on a virtual machine, specify the absolute file path. Relative file paths are supported only when copying files from a local storage. | true | false | |
| Destination | Specify the destination path where you want to copy the file. If the destination points to a virtual machine, specify the absolute file path. Relative destination paths are supported only when copying files to a local storage. | true | false | |
| GuestToLocal | Indicate that you want to copy a file from the guest operating system of the virtual machine to a local directory. | true | false | |
| Force | Indicate that the non-existing directories in the specified destination path are automatically created. | false | false | |
| VM | Specify the virtual machine where the file is located. | true | true (ByValue) | |
| HostCredential | Specify a PSCredential object that contains credentials for authenticating with the host where the file is to be copied. Do not use this parameter if the -HostUser and -HostPassword parameters are used. | false | false | |
| HostUser | Specify the user name you want to use for authenticating with the host where the file is to be copied. | false | false | |
| HostPassword | Specify the password you want to use for authenticating with the host where the file is to be copied. | false | false | |
| GuestCredential | Specify a PSCredential object that contains credentials for authenticating with the guest OS where the file to be copied is located. | false | false | |
| GuestUser | Specify the user name you want to use for authenticating with the guest OS where the file to be copied is located. | false | false | |
| GuestPassword | Specify the password you want to use for authenticating with the guest OS where the file to be copied is located. | false | false | |
| ToolsWaitSecs | Specify the time in seconds to wait for a response from the VMware Tools. If a non-positive value is provided, the system waits infinitely long time. | false | false | 20 |
| Server | Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. | false | false | |
| WhatIf | Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false | |
| Confirm | If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. | false | false | $true |
| LocalToGuest | Indicate that you want to copy a file from a local directory to the guest operating system of the virtual machine. | true | false | $true |
-------------- Example 1 --------------
Copy-VMGuestFile -Source c:\text.txt -Destination c:\temp\ -VM VM -GuestToLocal -HostUser root -HostPassword pass1 -GuestUser user -GuestPassword pass2
Copies the text.txt file from the guest OS system to the local Temp directory.