8 Replies Latest reply on Oct 3, 2016 9:55 AM by ThomasLooper

    Script to list VM Network Adapter Type, exporting issue

    Ben Liebowitz Expert
    vExpert

      Hi,

       

      I wrote a PowerCLI script to list network adapters that are NOT VMXNet3.  The syntax works fine in PowerCLI however the Export-csv command is creating a 0k csv file.

       

      Get-VM | Get-NetworkAdapter | Where-object {$_.Type -ne "Vmxnet3"} | foreach ($_) {Write-Host $_.Parent.Name "("$_.Name") type:" $_.Type} | export-Csv  c:\Network_Interface.csv -NoTypeInformation

       

      Results look like:

      VM1 ( Network adapter 1 ) type: Flexible
      VM2 ( Network adapter 1 ) type: e1000

       

       

      Any help would be appreciated.

       

      - Ben