The ESXi Host API Version is 4.1 so I cannot use Get-ESXCli
I want to use PowerCLI to get these two values. Any ideas on this?
Thanks,
DEMPC
Perhaps this thread can help Re: NIC & Storage Driver Version and Firmware ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I resorted to using plink.exe and get-content.
Thanks for the suggestion, though.
DEMPC
Hi
Welcome to the communities.
Along with Get-Excli you need to run $ esxcli = Get-Esxcli
As I stated my API version is 4.1. Get-EsxCLI is only available in 5.0 and higher.
Here is the syntax:
#Specify Variables
$User = "root"
$plink = "E:\plink.exe"
$plinkoptions = " -v -pw $Pswd"
#Remote Commands
$Command1 = "vem version"
$command2 = "vmkload_mod -s enic | grep Version"
$command3 = "vmkload_mod -s fnic | grep Version"
#Run Command s
Write-Host "Run Command 1"
$VEMcommand = $plink + " " + $plinkoptions + " " + $User + "@" + $vmhost.name + " " + "`"" + $Command1 + "`""
$VEM = Invoke-Expression -command $VEMcommand -ErrorAction SilentlyContinue
$info.VEMVersion = ($vem | select -Index 1).split(' ')[2]
$info.VSMVersion = ($vem | select -Index 2).split(' ')[2]
$eNICCommand = $plink + " " + $plinkoptions + " " + $User + "@" + $vmhost.name + " " + "`"" + $Command2 + "`""
$eNIC = Invoke-Expression -command $eNICCommand -ErrorAction SilentlyContinue
$info.eNICVersion = $enic.split(',')[0].split(' ')[3]
$fNICCommand = $plink + " " + $plinkoptions + " " + $User + "@" + $vmhost.name + " " + "`"" + $Command3 + "`""
$fNIC = Invoke-Expression -command $fNICCommand -ErrorAction SilentlyContinue
$info.fNICVersion = $fnic.split(',')[0].split(' ')[3]
Using "Get-EsxCLI"
$esxcli = Get-EsxCli -VMHost $vmhost |
$info.VEMVersion = ($esxcli.software.vib.list() | ? {$_.name -match 'vem'}).version | ||
$info.eNICVersion = $esxcli.system.module.get("enic").version | ||
$info.fNICVersion = $esxcli.system.module.get("fnic").version |