< Back

Get-Snapshot

Sun Jan 19, 2020 6:52 pm

NAME Get-Snapshot



SYNOPSIS

This cmdlet retrieves the virtual machine snapshots available on a vCenter Server system.





SYNTAX

Get-Snapshot [-VM] <VirtualMachine[]> [[-Name] <String[]>] [-Id <String[]>] [-Server <VIServer[]>]

[<CommonParameters>]





DESCRIPTION

This cmdlet returns information about the snapshots that correspond to the filter criteria provided by the Name

and VM parameters. The disk size of the snapshots is retrieved only if you have the "Datastore/Browse datastore"

privilege to the datastore where the shapshot is located. Otherwise, the following message is displayed: "Unable

to populate snapshot size due to unsufficient permissions."





PARAMETERS

-Id <String[]>

Specifies the IDs of the snapshots you want to retrieve.



Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that

matches exactly one of the string values in that list.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Name <String[]>

Specifies the names of the snapshots you want to retrieve.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Server <VIServer[]>

Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this

parameter, the command runs on the default servers. For more information about default servers, see the

description of Connect-VIServer.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-VM <VirtualMachine[]>

Specifies the virtual machines whose snapshots you want to retrieve. The position of this parameter is

deprecated and will be changed in a future release. To avoid errors when you run existing scripts on future

PowerCLI versions, specify the parameter by name.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more Snapshot objects







NOTES









-------------------------- Example 1 --------------------------



Get-Snapshot -VM VM -Name 'Before ServicePack 2'



Retrieves the snapshot named "Before ServicePack2" of the VM virtual machine.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... pshot.html

New-Snapshot

Remove-Snapshot

Set-Snapshot