Another one for VMware, you guys feel free to leave comments supporting my case. 
Right now this is what you get when vmtools is not running:
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:
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
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 (http://powerscripting.net)
Tags:
get-vmguest