- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could do something like this (it handles VSS and VDS).
ForEach-Object -Process {
$esxcli = Get-EsxCli -VMHost $esx -V2
$esxcli.network.vswitch.standard.list.Invoke() |
ForEach-Object -Process {
$vss = $_
$vss.Uplinks | where{$_ -ne $null} | %{
$nic = $_
$esxcli.network.nic.get.Invoke(@{nicname="$_"}) |
Select @{N='VMHost';E={$esx.Name}},
@{N='Switch';E={$vss.Name}},
@{N='NIC';E={$nic}},
LinkStatus
}
}
$esxcli.network.vswitch.dvs.vmware.list.Invoke() |
ForEach-Object -Process {
$vds = $_
$vds.Uplinks | where{$_ -ne $null} | %{
$nic = $_
$esxcli.network.nic.get.Invoke(@{nicname="$_"}) |
Select @{N='VMHost';E={$esx.Name}},
@{N='Switch';E={$vds.Name}},
@{N='NIC';E={$nic}},
LinkStatus
}
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference