In part 3 we utilized the HP Functions to update the TPM and System Firmware (BIOS). This time lets run the HP Imaging Assistant (HPIA) to get the latest drivers, firmware, and software.

Part 1 – OSDCloud with HP Functions
Part 2 – OSDCloud with HP Funtions: Loading OSDCloudGUI
Part 3 – OSDCloud with HP Functions: Updating TPM and BIOS
Part 4 – You are here
Additional Information
If you aren’t already familiar with it, check out the HP Image Assistant.
- HP Image Assistant (HPIA)
- Tool to Update Drives and Firmware, Create Drive Packages, and other useful functions.
Starting Information
If you are running Start-OSDCloudGUI and want to see the process to load the GUI for the HPIA Functions, check out Part 2 of the series for that.
Otherwise, we are going to start by calling the ‘Invoke-OSDCloud’ with an assumption that at least 1 of the 4 variables are set
- HPIAALL = $true
- HPIADrivers = $true
- HPIAFirmware = $true
- HPIASoftware = $true
Invoke-OSDCloud
So this is where the magic happens!
View the whole functions on Github

- Make sure we are connected to the internet
- This is required because otherwise we can’t check or download the updates.
- Next we’ll make sure that the System we are running on is supported by HP Imaging Assistant
- Here we set a variable to be used later.
- It will tell the script to add the required lines of code to the Specialize phase of Windows Setup.
- We won’t go into the detail of this running because currently this is used for TPM and BIOS updates.
- OSDCloud with HP Functions: Updating TPM and BIOS – Part 3 – Michael the Admin
- Another variable that we set to tell the script to Save the HP CMSL PowerShell module to the OSDCloud folder
- Now lets install the HP CMSL
Test-HPIASupport
View the whole function on Github

- Download the ‘platformList.cab’ for HPIA
- Get the Machine Platform currently being used
- Check the Machine Platform is in the Support List for HPIA
Install-ModuleHPCMSL
This function installs the HP CMSL PS module from the PowerShell Gallery if not already installed.
View the whole function on Github

- Set the PS Module name ‘HPCMSL’
- Check if the Module is already installed
- Get the module from the PSGallery
- If the Module is already installed, check that it is at least the version in the PSGallery
- Whether we need an upgrade or install
- Install the module for [AllUsers]
- And finally Import the module for use
Invoke-OSDCloud – HP.JSON
Back in the main script, lets create a Json file with the actions needing to be performed during the SetupComplete phase.

- Just incase any of the options were never set, or are $null, mark them $false
- Build a Hash Table of all HP Options values
- Create a file ‘C:\OSDCloud\Configs\HP.JSON’ and output the Hash Table to it.
- Run the ‘Set-SetupCompleteHPAppend’ function.

The file will look something like above.
Set-SetupCompleteHPAppend
This function Adds the necessary lines of PowerShell code to the SetupComplete.ps1 file to run the different HP Functions options.
View the function on Github

- Set the SetupComplete scripts path and create it
- Create an array with the Names of the Files and Paths for the SetupComplete scripts
- Add the lines of PowerShell needed to run HPIA with the options that were selected
- Enable the HP BIOS Setting ‘ Virtualization Technology (VTx)
- If you selected to update the TPM as well, then this would have been set to ‘Disabled’.
- Setting it back after we disabled
- This line call the function ‘Invoke-HPIA’ with the appropriate category [ All, Drivers, Software, Firmware ]
Invoke-HPIA
This function runs HPIA during the SetupComplete phase that was setup by the Set-SetupCompleteHPAppend function
View the function on Github
OSD/Public/OSDCloudTS/Invoke-HPIA.ps1 at master · OSDeploy/OSD (github.com)

- Define the ‘Interactive’ and ‘SilentMode’ command lines
- Install the HPIA tool
- More on this function below
- Check if a Reference File was passed to the command
- Run HPIA
- Default Log Folder: $LogFolder = “$env:systemdrive\ProgramData\HP\Logs”
- Default Report Folder: $ReportsFolder = “$env:systemdrive\ProgramData\HP\HPIA”
- Run HPIA
- Process the ExitCode from the HPIA run
Install-HPIA
Install the latest HPIA tool to the default path “$env:ProgramFiles\HP\HPIA\bin”
View the function on Github
OSD/Public/OSDCloudTS/Invoke-HPIA.ps1 at master · OSDeploy/OSD (github.com)

- Download the latest HPIA cab to a ‘temp’ location
- Path is “$env:windir\Temp\HPIA”
- File name: “HPIAMsg.cab”
- Expand the cab file
- Path is “$env:windir\Temp\HPIA”
- File name: “HPIAMsg.xml”
- Parse the Softpaq download URL from the XML file
- If the ‘xml’ doesn’t exist, attempt to download from a hardcoded URL
- Check if the ‘HPImageAssistant.exe’ file already exists
- If so, verify the version is Latest
- Download HPIA if needed
- Extract tool to Install Path
- “$env:ProgramFiles\HP\HPIA\bin”
Lets give it a try
Again, lets run Invoke-OSDCloud on a HP ProDesk 600 G5 SFF and select the ‘HPIA All Options’.

While in WinPE and RUnning in the Invoke-OSDCloud Funtion

- Test HPIA Support and Install the HP CMSL PowerShell Module
- Build the HP.JSON file
- Since we selected ‘HPIA All = True’, we get a warning that it’ll add ‘about 20 Minutes to OOBE (Just a moment…)“
- While there is no logging while it is running, the ‘Set-SetupCompleteHPAppend’ runs at the end of this section
- Build and setup the Unattend Specialize phase
The rest of the script finishes and a Reboot of the system occurs
We start out with the normal screens, ‘Getting devices ready’ and ‘Starting services’, etc…



Specialize
The ‘Specialize’ script runs. Since we didn’t select BIOS or TPM updates, nothing occurs during this run.

SetupComplete
Next, we hit the ‘Just a moment…’ screen. This is when HPIA will run in the background.

What going on under the hood?
Lets start with what gets called.
During Invoke-OSDCloud, the ‘SetupComplete.cmd’ and ‘SetupComplete.ps1’ scripts get created within ‘C:\Windows\Setup\Scripts’

Setupcomplete.cmd gets called automatically by the setup process. This script just runs the SetupComplete.ps1 file.

SetupComplete.ps1 is where everything happens. Many of these lines are here by Default for OSDCloud, but these are the ones that concern this post.

- The log for this script is a Transcript that is saved to ‘C:\OSDCloud\Logs\SetupComplete.log‘
- This is the line that runs HPIA.
- -ReportsFolder
- Set the “Report” folder to ‘C:\OSDCloud\HP\HPIA‘
- This will contain the results of the HPIA run
- -HPIAInstallPath
- Set the HPIA Install path to ‘C:\OSDCloud\HP\HPIA\Bin‘
- Where the HPIA Binaries will be saved and ran from
- -ReportsFolder
The Transcript for the script looks like below. You can see the middle section contains the HPIA stuff included the Results of the run. A 3010 in this case.

We can view what happened during the run by looking at the ‘Report Folder’ in ‘C:\OSDCloud\HP\HPIA\<Date-Time>\‘

We can view the ‘Readme (<Date-Time>).html‘ file to see what got installed.

- During this run, a BIOS update was performed and required a Reboot.
Post SetupComplete
After the HPIA and SetupCompelete process, a reboot was performed because 2x items during the HPIA exited with code 3010. Specifically, a BIOS Update.




After the BIOS update, we finish up on the OOBE screen

Conclusion
Again, there is so much happening that you don’t see on the screen.
Another huge shot out to @gwblok for all this amazing work. Legend.