Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

You were nearly there (and there is no need to do another Get-VM).

Replace the commented out line

$snap.NeedsConsolidation = $_.ExtensionData.Runtime.consolidationNeeded

by

$snap.NeedsConsolidation = $_.Vm.ExtensionData.Runtime.consolidationNeeded

and add the new property on the Select line

$Snap = {} | Select VM,Name,Created,Description,Host,NeedsConsolidation

and finally correct the propertyname on the output line

Write-Output "<td>$($snapshot.vm)</td><td>$($snapshotname)</td><td>$($snapshot.created)</td><td>$($snapshot.description)</td><td>$($snapshot.host)</td></td>$($snapshot.NeedsConsolidation)</td><tr> "


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos