PowerCLI Script to get ESXi Network/Storage Firmware and Driver Version

This post was originally published on this site

Hi Admin,


Found this script which gets me firmware and driver info.



$vmhosts = Get-Cluster “clust01” | get-vmHost



$report = @()



foreach( $ESXHost in $vmhosts) {



$HWModel = get-vmHost $ESXHost | Select Name, Model

$esxcli = Get-ESXcli -vmhost $ESXHost



if($HWModel.Model -eq “ProLiant BL460c Gen9”)




$info = $esxcli.network.nic.get(“vmnic0”).DriverInfo | select Driver, FirmwareVersion, Version

$ModuleName = “$($info.Driver)”

$Firmware = “$($info.FirmwareVersion)”

$Driver = “$($info.Version)”

$elxnet = $esxcli.software.vib.list() | where { $_.name -eq “elxnet”}

$report += $info | select @{N=”Hostname”; E={$ESXHost}},@{N=”Hardware-Model”; E={$HWModel.Model}},@{N=”Adapter-Firmware”; E={$Firmware}}, @{N=”Network-Driver”; E={$Driver}}, @{N=”FC-Driver”; E={$elxnet.version.substring(0,14)}}







$report | out-gridview



Above works fine for my blade servers with CNAs.


But on some om my VMhost I have separate FC HBAs , and to get the driver info I use something like this :
$esxcli.system.module.get(“lpfc”) | Select-object @{N=”VMHostName”;E={$VMHostName}}, Module, Version


Possible to combine this line with my script someway?  




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.