Created
December 27, 2018 14:52
-
-
Save TScalzott/556984b1a187cd34b2409bfa0583f30f to your computer and use it in GitHub Desktop.
List VM Snapshots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-VM | | |
ForEach-Object { | |
$Snap = Get-Snapshot -VM $_ | |
if (($Snap | Measure-Object).Count -gt 0) { | |
Format-Table $_.Name, | |
@{N = "Num Snaps"; E = {($Snap | Measure-Object).Count}}, | |
@{N = "Total MB"; E = {($Snap | Measure-Object -Sum SizeMB).Sum}}, | |
@{N = "Total GB"; E = {($Snap | Measure-Object -Sum SizeGB).Sum}} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment