Skip to content

Instantly share code, notes, and snippets.

@rbocchinfuso
Created March 6, 2014 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rbocchinfuso/9400604 to your computer and use it in GitHub Desktop.
Save rbocchinfuso/9400604 to your computer and use it in GitHub Desktop.
Cleanup VM snapshots older than N days and prefixed with Y
Get-VM | Get-Snapshot -Name foo* | Where { $_.Created -lt (Get-Date).AddDays(-2)} | remove-snapshot -confirm:$false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment