This is the third version of the script solution; it is very simple.
You detect make/model in any way you would like to, create a rule based on BIOS version, if the rule match, nothing happens, otherwise it runs any command you want. That said, you could use this for other task as well. Most common question is “does it work with any Make/Model”`No, there are some vendors that does not provide the ability to run a BIOS upgrade silently without reboot without control, that is, the darn thing reboots immediately and that usually breaks the Task Sequence. I have one thing for those vendors to say “Shame on you!”
Here are older posts on the subject:
Detect the Model
The detection in the script is actually whatever you want, it is just a “If-then” here are two sample lines detection that you will find in the script
if($((Get-WmiObject Win32_ComputerSystem).model) -eq 'HP EliteBook 8560w'){} if($ModelAlias -eq 'HP EliteBook 8460p'){}
Use the detection method for each model you like, very simple
DETECT THE BIOS VERSION
This is also not that hard, here are 2 sample lines from the script
if($((Get-WmiObject Win32_Bios).SMBIOSBIOSVersion) -ne '68SCF Ver. F.63'){} if($((Get-WmiObject Win32_Bios).SMBIOSBIOSVersion) -ne '786G1 v01.27'){}
STORE THE UPGRADE FILES
The upgrade files are stored with the model name, like this:
THE SILENT COMMAND
You also need to figure out the command, not really hard, download the bios upgrade, read how to run it from a command line, update the script and you are done, here is a sample of one of those sections.
$Exe = 'hpqflash.exe' $Location = "$SCRIPTDIR\Source\HP EliteBook 8460p" $Executable = $Location + "\" + $exe Set-Location -Path $Location Invoke-Exe -Executable "$Executable" -Arguments "/s /f 68SCE.CAB" –Verbose
RUN THE SCRIPT
in MDT you can import the folder with the script as a application and set this as the command line:
PowerShell.exe -ExecutionPolicy Bypass -File Install-BIOSUpgrade.ps1
In ConfigMgr you can import this as a Package and then run the command line the same way
It is also possible to run this outside of a task sequence if you like, it works as a stand alone script, however, you cannot use the integration with MDT of course.
If you want it is possible to add a custom property in customsettings.ini, something like “NeedReboot”, then you can add the following to happen if the BIOS has been upgraded
$tsenv.Value(“NeedReboot”) = “YES”
If you then in the step after this, set a condition on a reboot step, well then it will reboot when needed, otherwise not, you can read about that in one of my old postings here