Another one for VMware, you guys feel free to leave comments supporting my case. :smileygrin:
Right now this is what you get when vmtools is not running:
48# $pvm[0] | Get-VMGuest State IPAddress OSFullName ----- --------- ---------- NotRunning 52# [bool]($pvm[0] | Get-VMGuest) True
To be consistent with other get-* cmdlets in powershell, this command should not return anything, or return $false. Because an object is returned, you cannot simply test for guest presence, you have to 1) remember what the state names are (e.g. running, notrunning), and 2) make an equation testing for the correct string, hoping you remembered it correctly. Alternately, you could do this:
if ( get-vmguest $_ ) { #do stuff here which requires the vmtools }
Hal Rottenberg
Co-Host, PowerScripting Podcast ()
Hal,
How do you differentiate between not running and not installed?
Good question. I don't know the right answer but it deserves discussion. Correct me if I'm wrong, but from a guest automation point-of-view both cases mean you cannot communicate in-band with the guest. Therefore the end result is the same, you won't be able to work with the members of the guest object.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)