Hi,
Below command shows all the network adapter names in single line. How can I get the VM Network adapter details along with its port group in separate lines ?
Please help!!
Get-VM vmbox01 | Select Folder, Name, @{N='NetworkName';E={(Get-NetworkAdapter -VM $_.Name)}}, @{N="Port Group";E={@(Get-VirtualPortGroup -vm $_.Name)}} | ft -auto
Try like this
Get-VM vmbox01 |
Get-NetworkAdapter |
Select @{N='Folder';E={$_.Parent.Folder.Name}},
@{N = 'VM'; E = { $_.Parent.Name } },
NetworkName,Name |
Format-Table -AutoSize
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
Get-VM vmbox01 |
Get-NetworkAdapter |
Select @{N='Folder';E={$_.Parent.Folder.Name}},
@{N = 'VM'; E = { $_.Parent.Name } },
NetworkName,Name |
Format-Table -AutoSize
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
that worked...thank you very much 🙂