VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Get VM Network Adapter details in different lines

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

ganapa2000_0-1675278294557.png

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

that worked...thank you very much 🙂

 

0 Kudos