forked from MSEndpointMgr/ConfigMgr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invoke-HPBIOSUpdate.ps1 version 1.0.3
- Loading branch information
Showing
1 changed file
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,13 @@ | |
Author: Lauri Kurvinen / Nickolaj Andersen | ||
Contact: @estmi / @NickolajA | ||
Created: 2017-09-05 | ||
Updated: 2018-06-14 | ||
Updated: 2019-04-30 | ||
Version history: | ||
1.0.0 - (2017-09-05) Script created | ||
1.0.1 - (2018-01-30) Updated encrypted volume check and cleaned up some logging messages | ||
1.0.2 - (2018-06-14) Added support for HPFirmwareUpdRec utility - thanks to Jann Idar Hillestad ([email protected]) | ||
1.0.3 - (2019-04-30) Updated to support HPQFlash.exe and HPQFlash64.exe | ||
#> | ||
|
||
[CmdletBinding(SupportsShouldProcess = $true)] | ||
|
@@ -118,6 +119,14 @@ Process { | |
$HPFirmwareUpdRec = Get-ChildItem -Path $Path -Filter "*.exe" -Recurse | Where-Object { $_.Name -like "HpFirmwareUpdRec.exe" } | Select-Object -ExpandProperty FullName | ||
} | ||
|
||
# Attempt to detect HPFirmwareUpdRec utility file name | ||
if (([Environment]::Is64BitOperatingSystem) -eq $true) { | ||
$HPFlashUtil = Get-ChildItem -Path $Path -Filter "*.exe" -Recurse | Where-Object { $_.Name -like "HPQFlash.exe" } | Select-Object -ExpandProperty FullName | ||
} | ||
else { | ||
$HPFlashUtil = Get-ChildItem -Path $Path -Filter "*.exe" -Recurse | Where-Object { $_.Name -like "HPQFlash64.exe" } | Select-Object -ExpandProperty FullName | ||
} | ||
|
||
if ($HPBIOSUPDUtil -ne $null) { | ||
# Set required switches for silent upgrade of the bios and logging | ||
Write-CMLogEntry -Value "Using HPBIOSUpdRec BIOS update method" -Severity 1 | ||
|
@@ -133,6 +142,14 @@ Process { | |
$FlashSwitches = " -s -r" | ||
$FlashUtility = $HPFirmwareUpdRec | ||
} | ||
|
||
if ($HPFlashUtil -ne $null) { | ||
# Set required switches for silent upgrade of the bios and logging | ||
Write-CMLogEntry -Value "Using HPFirmwareUpdRec BIOS update method" -Severity 1 | ||
# This -r switch appears to be undocumented, which is a shame really, but this prevents the reboot without exit code. The command now returns a correct exit code and lets ConfigMgr reboot the computer gracefully. | ||
$FlashSwitches = " -s -r" | ||
$FlashUtility = $HPFlashUtil | ||
} | ||
|
||
if (-not($FlashUtility)) { | ||
Write-CMLogEntry -Value "Supported upgrade utility was not found." -Severity 3; exit 1 | ||
|
@@ -174,7 +191,7 @@ Process { | |
|
||
# Supend Bitlocker if $OSVolumeEncypted is $true | ||
if ($OSDriveEncrypted -eq $true) { | ||
Write-CMLogEntry -Value "Suspending BitLocker protected volume: $($env:SystemDrive)" -Severity | ||
Write-CMLogEntry -Value "Suspending BitLocker protected volume: $($env:SystemDrive)" -Severity 1 | ||
Manage-Bde -Protectors -Disable C: | ||
} | ||
|
||
|