Are you sure you have VMs with a snapshot, and that need consolidation ?
I use the following to find VMs that need consolidation.
$splatVM = @{
ViewType = "VirtualMachine"
Property = "Name","Runtime.ConsolidationNeeded"
Filter = @{"Runtime.ConsolidationNeeded"="True"}
}
Get-View @splatVM | Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference