alanrenouf / vCheck-vSphere

vCheck Daily Report for vSphere
MIT License
733 stars 325 forks source link

sorting by snashot size not working #708

Open pratikprays opened 4 years ago

pratikprays commented 4 years ago

unable to sort by snapshot Size in snapshot information plugin.it is sorting by default by VM name even after sort-object SizeGb is provided.

lucdekens commented 4 years ago

Did you adapt plugin 02 Snapshot Information? What did you change and where?

It should be sufficient to add a Sort-Object to the end of the line.

$VM | Get-Snapshot | Where-Object {$_.Created -lt (($Date).AddDays(-$SnapshotAge))} | Get-SnapshotSummary | Where-Object {$_.SnapName -notmatch $excludeName -and $_.Description -notmatch $excludeDesc -and $_.Creator -notmatch $excludeCreator} | Sort-Object -Property SizeGB