PowerShell Logo Small

Restore-VMSnapshot



This is the built-in help made by Microsoft for the command 'Restore-VMSnapshot', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Restores a virtual machine snapshot.

SYNTAX


Restore-VMSnapshot [-Name] <String> [-VMName] <String> [-AsJob] [-ComputerName <String[]>] [-Passthru] [<CommonParameters>]
Restore-VMSnapshot [-VM] <VirtualMachine> [-AsJob] [-Passthru] -Name <String> [<CommonParameters>]
Restore-VMSnapshot [-VMSnapshot] <VMSnapshot[]> [-AsJob] [-Passthru] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Restore-VMSnapshot cmdlet restores a virtual machine snapshot.



<

RELATED LINKS






REMARKS

<

Examples


Example 1

PS C:\>Restore-VMSnapshot –Name ‘Base image’ –VMName TestVM
Confirm
Are you sure you want to perform this action?
Restore-VMSnapshot will restore snapshot "Base image".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "Y"): Y



Restores snapshot Base image of virtual machine TestVM.




Example 2

PS C:\>Get-VM | Foreach-Object { $_ | Get-VMSnapshot | Sort CreationTime | Select -Last 1 | Restore-VMSnapshot -Confirm:$false }



Applies the most recent snapshot on all virtual machines with no confirmation prompts.