Skip to content

Instantly share code, notes, and snippets.

@simonjgreen
Last active February 25, 2017 22:06
Show Gist options
  • Save simonjgreen/fc2feeb98b27a5516729bf290c82172e to your computer and use it in GitHub Desktop.
Save simonjgreen/fc2feeb98b27a5516729bf290c82172e to your computer and use it in GitHub Desktop.
PowerCLI function to get a report on all snapshots with detail
function Get-SnapshotReport {
Get-VM | Sort-Object | Get-Snapshot | Where-Object {$_.Created -lt (Get-Date).AddDays(-28)} | Format-Table VM, Created, @{Name="Size GB"; Expression={$_.SizeGB}; FormatString="N1"}, ParentSnapshot, Name, Description, PowerState -AutoSize
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment