I'm trying to determine the networks available to vm's in my cluster. If I run a powershell script with this in it...
Connect-VIServer ServerName
$net = Get-NetworkAdapter -VM "TestVM"
echo $net
MacAddress : 00:50:56:88:02:ed
WakeOnLanEnabled : True
NetworkName : Network1
Type : Flexible
ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl
Id : VirtualMachine-vm-594/4000
Name : Network Adapter 1
MacAddress : 00:50:56:98:46:18
WakeOnLanEnabled : True
NetworkName : Network2
Type : Flexible
ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl
Id : VirtualMachine-vm-594/4001
Name : Network Adapter 2
My question is, how can I input the value of NetworkName into a variable so that I can do a comparison? Or is there a better way to get the values of NetworkName?
Tags:
cmdlet,
powershell,
get-networkadapter