Reputation: 1490
I am using the following command to get VMNetworkAdapter details:
Get-VMNetworkAdapter -ManagementOS
This provides output in the following format:
Name IsManagementOs VMName SwitchName
I just want the switch name. Do we have any option or flag?
edit: I found the new command to just get switch details
Get-VMSwitch
But this command also returns many fields, I want just the name of the switch.
Upvotes: 0
Views: 901
Reputation: 743
It's just need to select field
Get-VMNetworkAdapter -ManagementOS|Select -ExpandProperty SwitchName
Upvotes: 1