Reply to Message

View discussion in a popup

Replying to:
swamynaveen
Enthusiast
Enthusiast

@all, I'm getting below errors while fetching HBA /NIC firmware and driver version details. any suggestion would be really appreciated.

 
Script###### Start#################
vmhosts1 = Get-Content -Path "C:\Temp\HostList1.txt"


$report = @()

foreach ($ESXHost in $vmhosts1) {

$esxcli = Get-EsxCli -VMHost $ESXHost -V2

$nicfirmware = $esxcli.network.nic.list()

$fcfirmware = $esxcli.storage.san.fc.list()

$driversoft = $esxcli.software.vib.list()

foreach($nicfirmwareselect in $nicfirmware)



{



$NetworDescription = $nicfirmwareselect.Description



$NetworDriver = $driversoft | where { $_.name -eq ($nicfirmwareselect.Driver) }



$NetworkName = $nicfirmwareselect.Name



$NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)).DriverInfo.FirmwareVersion


$report += "" | select @{N = "Hostname"; E = { $ESXHost.Name } },



@{N = "Hardware-Model"; E = { $ESXHost.Model } },



@{N = "device"; E = { $NetworkName } },



@{N = "driver"; E = { $NetworDriver.Version } },



@{N = "firmware"; E = { $NetworkFirmware } },



@{N = "description"; E = { $NetworDescription } }



}



foreach($fcfirmwareselect in $fcfirmware)



{



$fcDescription = $fcfirmwareselect.ModelDescription



$fcDriver = $driversoft | where { $_.name -eq ($fcfirmwareselect.DriverName) }



$fcName = $fcfirmwareselect.Adapter



$fcFirmware = $fcfirmwareselect.FirmwareVersion







$report += "" |



select @{N = "Hostname"; E = { $ESXHost.Name } },



@{N = "Hardware-Model"; E = { $ESXHost.Model } },



@{N = "device"; E = { $fcName } },



@{N = "driver"; E = { $fcDriver.Version } },



@{N = "firmware"; E = { $fcFirmware } },



@{N = "description"; E = { $fcDescription } }



}



}

$report
 
Script###### End#################

 

 

Runtime Error:  no list method

Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'list'.
At line:18 char:1
+ $nicfirmware = $esxcli.network.nic.list()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (list:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'list'.
At line:22 char:1
+ $fcfirmware = $esxcli.storage.san.fc.list()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (list:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

 

Regards,

Naveen

Reply
0 Kudos