Now that you've created a bunch of snapshots in your environment, it is time to keep track of them. Creating a list of snapshots is extremely easy. This recipe will cover how to get that list and perform basic manipulation for reporting on your snapshots.
To begin this recipe, you will need a PowerCLI window and an active connection to the vCenter host. You will also need to have VMs with snapshots, either created as in the previous recipe or created by some other method.
In order to get the created list of snapshots and perform basic manipulation for reporting on these snapshots, perform the following steps:
The logical cmdlet to retrieve a list of snapshot objects is the
Get-Snapshot
cmdlet. You can assume that you can run it with no parameters, such asGet-VM
, and return a list of all the snapshots in the environment. If you execute the following cmdlet on its own, you get an error:Get-Snapshot