Well to completely beat a dead horse, heres a golfed version based on the discussion from Specific WMI Targets

Code:
function IsVMWare()
$IsVMWare=iif(instr(GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_ComputerSystem").item("Win32_Computersystem='@wksta'").Manufacturer,"VMWARE"),1,0)
Endfunction