Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

That is due to your screenwidth in the console.

Try adding Format-Table

Get-VMHost -PipelineVariable esx |

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

    }

  }

} | Format-Table -AutoSize


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post