Copy-VBRWindowsGuestItem
Short Description
Copies Microsoft Windows guest OS files to the target host.
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
|
Copy-VBRWindowsGuestItem -Item <VBRFLRFsItem[]> -TargetFolder <String> [-Session <CRestoreSession>] [-FileRestore <FileRestore>] [-KeepPermissionsAndOwnership] [-GuestCredentials <CCredentials>] [-ShareCredentials <PSCredential>] [-RunAsync] [<CommonParameters>] |
Detailed Description
This cmdlet copies Microsoft Windows guest OS files to the target host.
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept Pipeline Input |
|---|---|---|---|---|---|
|
FileRestore |
Specifies a restore session of Microsoft Windows guest OS files. The cmdlet will use this session to restore guest OS files. Note: The restore session must be started within the current PowerShell session.
This parameter is required if the
Accepts the |
|
False |
Named |
False |
|
GuestCredentials |
Specifies the credentials of the target machine. Note: If you do not specify credentials, the cmdlet will try to use the credentials from the current PowerShell session.
Accepts the |
|
False |
Named |
False |
|
Item |
Specifies an array of Microsoft Windows guest OS files. The cmdlet will copy these files.
Accepts the |
|
True |
Named |
True (ByPropertyName, ByValue) |
|
KeepPermissionsAndOwnership |
Defines that the cmdlet will keep custom permissions and the ownership of the copied guest OS files. If you do not provide this parameter, the cmdlet will restore guest OS files with default permissions and ownership.
Default: |
|
False |
Named |
False |
|
RunAsync |
Defines that the command returns immediately without waiting for the task to complete. |
|
False |
Named |
False |
|
Session |
Specifies a restore session of Microsoft Windows guest OS files. The cmdlet will use this session to copy guest OS files.
This parameter is required if the
Accepts the |
|
False |
Named |
False |
|
ShareCredentials |
For copying guest OS files to a shared folder. Specifies credentials that you want to use to authenticate with the target shared folder to which you copy guest OS files.
Accepts the |
|
False |
Named |
False |
|
TargetFolder |
Specifies a folder in the target machine. The cmdlet will copy the guest OS files to this folder. |
|
True |
Named |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.
Examples
Copying Microsoft Windows Guest OS Files to Target Folder
This example shows how to copy files from the backup of the WinSrv25 Windows machine to the D:\Copies folder. The cmdlet will keep all custom permissions and ownership of the copied files.
|
$backup = Get-VBRBackup -Name "WinSrv25" $restorepoint = Get-VBRRestorePoint -Backup $backup -Name "Production VM" $session = Start-VBRWindowsFileRestore -RestorePoint $restorepoint $items = Get-VBRWindowsGuestItem -FileRestore $session -Name "Reports" Copy-VBRWindowsGuestItem -Item $items -TargetFolder "D:\Copies" -FileRestore $session -KeepPermissionsAndOwnership |
Perform the following steps:
- Get the restore session.
- Run the
Get-VBRBackupReturns backups. cmdlet. Specify theNameparameter value. Save the result to the$backupvariable. - Run the
Get-VBRRestorePointReturns restore points. cmdlet. Set the$backupvariable as theBackupparameter value. Specify theNameparameter value. Save the result to the$restorepointvariable. - Run the
Start-VBRWindowsFileRestoreStarts Windows VM guest OS file restore session. cmdlet. Set the$restorepointvariable as theRestorePointparameter value. Save the result to the$sessionvariable.
- Run the
- Run the
Get-VBRWindowsGuestItemReturns Microsoft Windows guest OS files. cmdlet. Specify the$sessionvariable as theFileRestoreparameter value. Specify theNameparameter value. Save the result to the$itemsvariable. - Run the
Copy-VBRWindowsGuestItemcmdlet. Specify the following settings:- Set the
$itemsvariable as theItemparameter value. - Specify the
TargetFolderparameter value. - Set the
$sessionvariable as theFileRestoreparameter value. - Provide the
KeepPermissionsAndOwnershipparameter.
- Set the
Related Commands
Get-VBRBackupReturns backups.Get-VBRRestorePointReturns restore points.Start-VBRWindowsFileRestoreStarts Windows VM guest OS file restore session.Get-VBRWindowsGuestItemReturns Microsoft Windows guest OS files.