Start-VBRWindowsGuestItemRestore

In this article

    Short Description

    Starts a restore of Microsoft Windows guest OS files to original location.

    Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

    Syntax

    Start-VBRWindowsGuestItemRestore -Path <String[]> -Session <CRestoreSession> -RestorePolicy <VBRWindowsGuestItemRestorePolicy> [-GuestCredentials <CCredentials>] [<CommonParameters>]

    Detailed Description

    This cmdlet starts to restore Microsoft Windows guest OS files to original location.

    Note

    To restore guest OS files, you need to start the restore session by running the Start-VBRWindowsFileRestore cmdlet.

    Parameters

    Parameter

    Description

    Type

    Required

    Position

    Accept Pipeline Input

    Path

    Specifies an array of file paths that you want to restore.

    Note: The file paths must be as in the VM, for example, C:\Files. Do not write the mount server path here.

    String[]

    True

    Named

    True (ByValue,
    ByProperty
    Name)

    Item

    Specifies an array of files and folders that are available on disks of Microsoft Windows VMs. The cmdlet will restore these files and folders.

    Accepts the VBRFLRFsItem[] object. To create this object, run the Get-VBRWindowsGuestItem cmdlet.

    True

    Named

    True (ByValue,
    ByProperty
    Name)

    Session

    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.

    Accepts the CRestoreSession object. To create this object, run the Start-VBRWindowsFileRestore cmdlet.

    True

    Named

    False

    RestorePolicy

    Specifies the file restore policy:

    • Keep: Use this option if you want to restore the files with the _restored postfix next to the original file.
    • Overwrite: Use this option if you want to replace the original files with the restored files.

    VBRRestorePolicy

    True

    Named

    False

    GuestCredentials

    Specifies the credentials for the target VM.

    Note: If you do not specify credentials, the cmdlet will try to use the credentials from the current PowerShell session.

    Accepts the CCredentials object. To create this object, run the Get-VBRCredentials cmdlet.

    False

    Named

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

    Output Object

    The cmdlet returns the CRestoreTaskSession object that object that contains setting of an operation that you perform to restore Microsoft Windows guest OS files to the source VM.

    Examples

    Restoring Windows Guest OS File by Providing File Path

    This example shows how to restore the January.xlsx file by specifying the C:\Projects\2020\January.xlsx file path from a backup of the WinSrv25 Windows VM.

    $backup = Get-VBRBackup -Name "WinSrv25"

    $restorepoint = Get-VBRRestorePoint -Backup $backup -Name "Production VM"

    $session = Start-VBRWindowsFileRestore -RestorePoint $restorepoint

    Start-VBRWindowsGuestItemRestore -Path "C:\Projects\2020\January.xlsx" -Session $session[0] -RestorePolicy Overwrite

    Perform the following steps:

    1. Run the Get-VBRBackup cmdlet. Specify the Name parameter value. Save the result to the $backup variable
    2. Run the Get-VBRRestorePoint cmdlet. Specify the Backup and Name parameter values. Save the result to the $restorepoint variable.
    3. Run the Start-VBRWindowsFileRestore cmdlet. Specify the RestorePoint parameter value. Save the result to the $session variable.
    4. Run the Start-VBRWindowsGuestItemRestore cmdlet. Specify the following settings:
    • Provide the Path parameter value.
    • Set the $session[0] variable as the Session parameter value.

    The Start-VBRWindowsFileRestore cmdlet will return an array of active restore sessions. Mind the ordinal number of the necessary restore session (in our example, it is the first restore session in the array).

    • Specify the RestorePolicy parameter value.

    Related Commands