Find old VMware snapshots
Documentation: Microsoft Learn
Find VMware snapshots older than seven days with Get-Snapshot. Report the VM, snapshot name, creation date, and size in GB.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Prerequisite: this needs the VMware PowerCLI module and an active vCenter connection (Connect-VIServer) — Get-VM and Get-Snapshot are PowerCLI cmdlets, not built-in.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-VM | Get-Snapshot | Where-Object Created -lt (Get-Date).AddDays(- 7) | Select-Object VM,Name,Created,SizeGB- Stage 1Get-VM
Positional values or no named parameters - Stage 2Get-Snapshot
Positional values or no named parameters - Stage 3Where-Object
-lt - Stage 4Select-Object
Positional values or no named parameters
How it works
Every guest is piped into Get-Snapshot, Where-Object keeps snapshots whose Created date predates a seven-day cutoff, and the projection reports the owning VM with the snapshot name, creation date, and SizeGB.
Adapting it
Sort on SizeGB descending to attack the space problem directly, because one large snapshot usually accounts for more reclaimable capacity than a dozen small ones combined.
Requirements
VMware PowerCLI with an active Connect-VIServer session.
If the result is unexpected
An old-snapshot report leads to an unsafe cleanup recommendation.
Snapshot age alone does not establish its purpose, consolidation cost or active backup dependency.
- Identify the owning VM, snapshot hierarchy and any backup operation before proposing removal.
Validate the result
Every candidate has owner review and an assessed consolidation plan.
Keep the check reliable
Separate reporting from removal and monitor datastore capacity during approved consolidation.