Initialize-HPBiosConfigUtility
Overview
This script automates downloading/extracting the BCU package, verifying the BCU executable, running BCU to read or apply BIOS settings, and interpreting BCU exit codes into human-readable messages.
References:
- HP BIOS Configuration Utility | HP Client Management Solutions
- BIOS_Configuration_Utility_User_Guide.pdf
Requirements
- Windows on HP hardware (manufacturer must be 'HP' or 'Hewlett').
- Administrative privileges (required to write to ProgramData, install utilities, and access BIOS/WMI namespaces).
- PowerShell 5.0 or later (script declares #requires -Version 5).
- Internet access to download the BCU package if it is not present locally.
- Strapper PowerShell module (the script will update/install it automatically if missing).
- NuGet package provider (auto-bootstrapped by the script if missing).
Process
The script follows these main steps:
- Enforce secure TLS policy (prefers TLS 1.3 then TLS 1.2) for downloads.
- Prepare working directories under ProgramData where the installer, extraction, and report files are stored.
- Ensure Strappermodule is available and callSet-StrapperEnvironmentfor consistent logging utilities such asWrite-Log.
- Validate host manufacturer is HP and OS is compatible; exit early on unsupported hosts.
- Install or verify the HP BIOS Configuration Utility (BCU) by downloading the installer archive and extracting it to the configured extract path.
- Locate the BCU executable (BIOSConfigUtility64.exe) in the extraction folder.
- Execute BCU with provided arguments (or default /get) and capture output and exit codes.
- Parse XML output (when present) to retrieve the BIOS return code, and call Convert-ExitCodeto map the numeric code to a descriptive message and log the result.
- Return the raw command output (and log success/failure). Functions return boolean success/failure for programmatic use.
Payload Usage
This script accepts an optional -Argument string which is forwarded to the BCU executable. If omitted, the script defaults to running BCU with /get to retrieve BIOS configuration.
Example usage:
Run a read-only configuration scan (installs BCU if missing):
.\Initialize-HPBiosConfigUtility.ps1
Get the current value of the "Fast Boot" setting:
.\Initialize-HPBiosConfigUtility.ps1 -Argument '/getvalue:"Fast Boot"'
Set the "Fast Boot" setting to "Enable":
.\Initialize-HPBiosConfigUtility.ps1 -Argument '/setvalue:"Fast Boot","Enable"'
Display BCU help and supported commands:
.\Initialize-HPBiosConfigUtility.ps1 -Argument '/help'
Parameters
| Parameter | Alias | Required | Default | Type | Description | 
|---|---|---|---|---|---|
| Argument | False | '/get' | String | Arguments to forward to the BCU executable (e.g. '/get', '/set:"Name=Value"', '/setconfig config.txt'). | 
Output
The script writes logs using the Write-Log function (provided by the Strapper module). It returns the raw output produced by the BCU executable (string/array) and logs a clear interpretation of the return code.
Log and error files (location depends on Strapper configuration; defaults are):
.\Initialize-HPBiosConfigUtility-log.txt .\Initialize-HPBiosConfigUtility-error.txt