Posted on GARYTOWN.COM Categories Bios, HP, PowerShell Post navigationĪwesome idea and great script indeed! I've implemented this as a step in my OSD Task Sequence but finetuned it and added some features:
Bitlocker download and install install#
Write-Output "HP BIOS update Applied, Will Install after next reboot" #Start-Process "$($ExtractedPath)\HPFirmwareUpdRec64.exe" -ArgumentList "-s -r -b -l$($HPContent)\HPBIOSUpdate.log" -wait Write-Output "Using HPFirmwareUpdRec64.exe to Flash BIOS with Args -s -r -b -l" If (Test-Path "$($ExtractedPath)\HPFirmwareUpdRec64.exe") #Start-Process "$($ExtractedPath)\HPBIOSUPDREC64.exe" -ArgumentList "-s -r -b -l$($HPContent)\HPBIOSUpdate.log" -wait Write-Output "Using HPBIOSUpdRec64.exe to Flash BIOS with Args -s -r -b -l" If (Test-Path "$($ExtractedPath)\HPBIOSUPDREC64.exe") Suspend-BitLocker -MountPoint "C:" -RebootCount 1 If ((Get-BitLockerVolume -MountPoint c:).VolumeStatus -eq "FullyDecrypted") Start-Process "$($DownloadPath)\$($BiosFileName)" -ArgumentList "-pdf -e -s -f$($ExtractedPath)" Write-Output "Extracting Downloaded BIOS File to: $($ExtractedPath)" $BiosFileName = Get-ChildItem -Path "$($DownloadPath)\*.exe" | select -ExpandProperty "Name" $BIOS | Out-File -FilePath "$($DownloadPath)\$($Bios.ReleaseDate).txt" Write-Output "Creating Readme file with BIOS Info HERE: $($DownloadPath)\$($Bios.ReleaseDate).txt" Get-Softpaq -number $BIOS.ID -saveAs "$($DownloadPath)\$($BIOS.id).exe" -Verbose Write-Output "Downloading BIOS Update for: $($Model) aka $($ProductCode)" $DownloadPath = "$($DownloadDir)\$($Model)\$($BIOS.Version)" Write-Output "Updated BIOS available, Version: $($BIOS.Version)" $BIOS = $BIOS | WHERE "ReleaseDate" -eq "$MostRecent" $MostRecent = ($Bios | Measure-Object -Property "ReleaseDate" -Maximum).Maximum $BIOS = Get-SoftpaqList -platform $ProductCode -os $OS -category $Category
Bitlocker download and install code#
Write-Output "Checking Product Code $($ProductCode) for BIOS Updates" Write-Output "Current Installed BIOS Version: $($CurrentBIOS)" Write-Output "Finished Downloading and Installing HP Module" Start-Process -FilePath "$($DownloadDir)\HPCM\*.exe" -ArgumentList "/SILENT" -wait Start-Process -FilePath "$($DownloadDir)\HPCM.exe" -ArgumentList "-pdf -e -s -f$($DownloadDir)\HPCM" -Wait Invoke-WebRequest -Uri $PoshURL -OutFile "$($DownloadDir)\HPCM.exe" Write-Output "HP Module Not Loaded, Loading. $Model = (Get-WmiObject -Class Win32_ComputerSystem).Model
$ProductCode = (Get-WmiObject -Class Win32_BaseBoard).Product
$ExtractedDir = "$($HPContent)\Extracted" Other considerations, this requires active internet connection, you might have to update script to work with a proxy. Once this happens, I'll test this again and update anything that needs to be updated. I heard HP is working on updating the Modules so it does work in WinPE, which would be great. It does not automatically reboot, you can modify script to do that, or have your deployment solution do it.