$vms = Get-VM Foreach ($vm in $vms){ if ((Get-View $vm).Guest.GuestFullName -match "linux" -or "windows"){ Write-Host $vm.Name, ',' (Get-View $vm).Guest.GuestFullName, ',' (Get-View $vm).Guest.ToolsStatus, ',' (Get-View $vm).Guest.IpAddress, ',' ($vm).VMHost, ',' ($vm).PowerState } }
Get basic VM details