Reputation: 33
I'm trying to make sure that I have the correct BIOS versions on a series of HP Proliant servers running ESXi. I would like to use PowerCLI to return the BIOS Major Release and BIOS Minor Release information for each host.
So far, when using PowerCLI to query the BIOS information, I only get the basic version information ("P89"), as shown below (I've obviously omitted the real hostname values):
PS \> Get-View -ViewType HostSystem -Filter @{'Name' = $servername} | select Name,
>> @{N='BIOSversion';E={$_.Hardware.BiosInfo.BiosVersion}}
Name BIOSversion
---- -----------
$servername P89
However, if I SSH into that host I can use 'vsish' to identify the BIOS Major Release and BIOS Minor Release information (i.e. v2.76):
root@<servername>: ~# vsish
/> get /hardware/bios/biosInfo
BIOS Information (type 0) {
BIOS Vendor:HP
BIOS Version:P89
BIOS Release Date:10/21/2019
BIOS Major Release:2
BIOS Minor Release:76
Embedded Controller Firmware Major Release:2
Embedded Controller Firmware Minor Release:73
}
Is there a way to use PowerCLI to return the BIOS Major Release and BIOS Minor Release data, without having to SSH into the host directly?
Thank you in advance!
Upvotes: 0
Views: 1134
Reputation: 25031
If the information is available in PowerCLI, it will be located at $_.Hardware.BiosInfo.MajorRelease
and $_.Hardware.BiosInfo.MinorRelease
. To join the major and minor versions using version syntax, you can do the following with the -join
operator:
Get-View -ViewType HostSystem -Filter @{'Name' = $servername} |
Select Name,@{N='BIOSversion';E={$_.Hardware.BiosInfo.BiosVersion}},
@{n='BIOSRelease';e={$_.HardWare.BiosInfo.MajorRelease,$_.Hardware.BiosInfo.MinorRelease -join '.'}}
Upvotes: 1