This must be a esy one, but I don't get the solution.
I would get all VM-Names with at least one snapshot. And because the get-snapshot cmdlet doesn't work well in 4.0u1 I don't want to use it.
I get all snapshots with:
$rootsnap = Get-View -ViewType VirtualMachine |%{$_.Snapshot.RootSnapshotList}
Now I would get the VM-Name. I tried it with:
foreach ($snap in $rootsnap){
$vmid = $snap.vm.type + "-" + $snap.vm.value
get-vm -id $vmid
}
this doesnt works, because sometimes the $snap is empty.