Hi all,
I'm not a powershell machine and need some help!
I need to run a script to get both the VMName and the NetworkName or the Label associated with that VM out. I can do one or the other but having difficulty putting it all together. I know this will be easy for someone so I will appreciate any help.
Don't want to be too fancy, just the NetworkName and the VMName. I know I should be able to build a pipeline but it's been a while since I've done any powershell stuff and I simply cannot remember.
Apriciations and thank you in advance.
$VIServer = Connect-VIServer -Server VirtualCenterServer
$VM = Get-VM
Get-NetworkAdapter -VM $VM | Select Name,NetworkName
The VM's name is available in the Parent property.
You can do
$VIServer = Connect-VIServer -Server VirtualCenterServer
$VM = Get-VM
Get-NetworkAdapter -VM $VM | Select Parent,Name,NetworkName
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The VM's name is available in the Parent property.
You can do
$VIServer = Connect-VIServer -Server VirtualCenterServer
$VM = Get-VM
Get-NetworkAdapter -VM $VM | Select Parent,Name,NetworkName
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That's fantastic thank you!