Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 228891

Re: VM List on conditions to be generated.

$
0
0

Can't you just update the script like this

$allvms = @()

 

$vmlist = Get-Vm | where {$_.PowerState -eq "PoweredOn"}

ForEach ($vm in $vmlist){

    $vmv = $vm | Get-View 

    $vms = "" | Select Name #, OS   

    if ($vmv.Config.GuestFullName -match "Windows"){

        $vms.Name = $vm.name

        $allvms += $vms

    }

}

$allvms | Out-File "D:\temp\computers.txt"


Viewing all articles
Browse latest Browse all 228891

Trending Articles