get-vm | get-snapshot | sort-object sizemb -descending | Remove-Snapshot -confirm:$false
If you want to do it for VMs of only a certain size, where snaps are larger than 1GB:
get-vm | get-snapshot | where {$_.SizeMB -gt 1024} | sort-object sizemb -descending | Remove-Snapshot -confirm:$false
Enjoy!
No comments:
Post a Comment