Reply to Message

View discussion in a popup

Replying to:
iamamit
Enthusiast
Enthusiast

You may try below one, should work for filtering only "Windows Xp" guest VMs.

--------------------------------------------------------------------------------------------------------------------------

$vms = Get-VM

Foreach ($vm in $vms){

     if ((Get-View $vm).Guest.GuestFullName -match "windows xp"){

               Write-Host $vm.Name, " => " , (Get-View $vm).Guest.GuestFullName

     }

}

--------------------------------------------------------------------------------------------------------------------------


You can check keeping "Xp" instead of "Windows Xp", it should also work..


Thanks,

Amit

Reply
0 Kudos