Get-Snapshot

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."

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
required
VM
VirtualMachine[] named
  • wildcards
  • pipeline
  • 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.
    optional
    Name
    String[] 1
  • wildcards
  • Specifies the names of the snapshots you want to retrieve.
    optional
    Id
    String[] named
  • wildcards
  • Specifies the IDs of the snapshots you want to retrieve.
    optional
    Server
    VIServer[] named
  • wildcards
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null 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.

    Output

    VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot

    Examples


    Example 1

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

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

    Related Commands

    Feedback

    Was this page helpful?