VMware Cloud Community
Guv
Enthusiast
Enthusiast

List snapshots by size and age

Can anyone advise on a powershell script which lists all snapshots on the VM's in virtual centre.  Also the size of the snapshot in GB.

So it would look like:

VM Name,  Snapshot Name, Size in G, age

Is the age column possible on how old the snapshot is.

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

Try something like this

Get-VM | Get-Snapshot | 
Select @{N="VMName";E={$_.VM.Name}},Name,
@{N="Size GB";E={[int]($_.SizeMb/1KB)}},
@{N="Age";E={[int](New-TimeSpan -Start $_.Created -End (Get-Date)).TotalDays}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Rumple
Virtuoso
Virtuoso

download vcheck v6..I think it does snapshot name and age...could be changed to add in size I suppose...

I find age is the primary look for me since nothing should be over a few days anyhow

Reply
0 Kudos