Quantcast
Viewing all articles
Browse latest Browse all 240675

Re: get-vm where statement to find windows with particular network

finally got it to work. i replaced the ( ) with { }, and putting the closing in the end, (red below)

 

the only missing piece is resouce pool which is not showing up in the output. shouldnt be too hard for me to figure out. thanks for your help!

 

Get-VM | where {$_.guest.osfullname -like "*windows*" -and {Get-NetworkAdapter -VM $_.networkname -like "*org*"}} | select Name,VMHost,Powerstate,OSName,
@{N="Cluster";E={Get-Cluster -VM $_ |select -ExpandProperty name}},
@{N="IP";E={[string]::Join(',',($_.Guest.IPAddress))}},
@{N="ResourcePool";E={Get-ResourcePool -VM $_ | Select -ExcludeProperty}}


Viewing all articles
Browse latest Browse all 240675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>