Controlling HP Image Assistant

HP Image Assistant (HPIA) analyzes a system by downloading a daily updated Reference File from HP. However, it can also analyze and take action from a local Reference File (scripting support added in version 5.1.6 - prior releases only allowed this from the GUI). With a properly modified reference file, HPIA would be able to use it to analyze and update a system based on specific needs. This blog demonstrates one solution that may enable an IT Administrator to use HPIA with a customized Reference File, providing some level of BIOS, driver, version control for a fleet of devices.

HP Image Assistant uses the data from the Reference File to compare versions of HP BIOS, drivers, and HP Software, to just report some recommendations required to keep a system up to date, or optionally to install any and all recommended updates.

The script described in this blog is available from Github. Note that this is not an official support method for customizing Reference Files. Use at your own risk.

NOTE: the HP Client Management Script Library (CMSL) is required to be available on the system running this script, and version of CMSL 1.6.8 is required if modifying a Reference File for Windows 22H2.

 

The Reference File

The XML formatted reference file contains a section with information about a device (and specific OS version) list of Softpaqs. With proper knowledge the section could be changed to list different versions of Softpaqs. Softpaqs are how HP names released packages for all HP BIOS, Drivers, and HP Software for devices.

Each reference file supports one platform (for example, an HP EliteBook 840 G8) and one Windows OS version (say Windows 10/21H2), which means a platform that supports several OS versions will have an equivalent number of reference files available.

The XML file (best viewed with an appropriate editor, such as Notepad++) is divided into sections. The section named <Solutions> contains the latest released versions of all Softpaqs tested and supported for the platform and OS version. This and other supporting sections in the file get updated daily and downloaded every time HPIA is executed.

NOTE: current platform Reference Files tend to contain more information than Reference files for systems no longer in production. However, because the number of Softpaqs versions increase over time as new updates are released, the overall size of these files will tend to grow for older systems - more versions of Softpaqs mean more information added to the file.

The script we will be discussing is designed to provide a means for an IT Administrator to modify the file in such a way as to allow control of what versions of Softpaqs are available to analyze against.

Caching Reference File in Script

By default, and when not using the -ReferenceFile argument, the script uses an HP CMSL cmdlet to find and download the current Reference File for the platform. The File is cached to a local caching folder. The script then makes a copy to the scripts' current folder for modifications

If the -ReferenceFile argument is used, the script creates a cache folder in the script's current directory and then makes a copy for modification. if the script is executed in a protected folder, it may not be able to create a 'Cache' subfolder and may not be able to accomplish its tasks. Therefore, you may want to run it from c:\Temp or a current user's folder instead

Reference File modification

Set-ReferenceFileSoftpaq is a PS script developed around the idea that a current, suggested Softpaq can be replaced with a previous version in the section HPIA finds the recommended current list.  Only previously supported versions of the same type can be used with the script to make sure an older version was approved at some point in time. That ensures that only tested Softpaqs are recommended and installed.  The question then is: how can I readily find all supported versions of a latest Softpaq?  The script provides options for discovery and could be useful to gather the information needed to customize the file for HPIA’s use.

The script’s command line options available are:

Set-ReferenceFileSoftpaq -Platform <SysID -OS <Win10|Win11> -OSVer <Supported Version> [-ReplaceSoftpaq <SoftpaqID>] [-ToSoftpaq <SoftpaqID>] [-ReferenceFile <File Path.xml>] [-ListByCategory <BIOS,Driver,etc.>] [-ListSuperseded <SoftpaqID]> [-ListNoSupersedes] [-CacheDir <File Path>]

The -Platform, -OS, and -OSVer options are mandatory and enable the script to download and cache the current Reference File. If the script executes without options, it will ask at the command line for these options, and if available, the associated Reference File will be cached, and a local copy made in the script’s folder that should be used for modification.

Let’s look at how some of the options can be used to get information about Softpaqs and how to modify the Reference File to meet a specific need.

 

Find all current, relevant Softpaqs by category:

For the purposes of this blog, let’s assume we want to modify what HPIA analyzes against for an HP EliteBook 840 G8 (platform ID 880D).  The platform ID (also known as SysID) can be obtained with the HP CMSL cmdlet

Get-HPDeviceDetails -like ‘840 g8’

Once you have the SystemID (same as Platform ID/SysID) from the results, you can then use it with the script.

NOTE: This particular platform shows three SystemIDs due to the fact that some components requiring motherboard updates were implemented to manage problems associated with the pandemic and supply chain. In the vast majority of HP business class endpoints, each system has a single platform ID.

So, we now want to find all available BIOS and Driver Softpaqs HPIA would recommend from the up-to-date list in the Reference File. We can run the following command to list all BIOS and Drivers Softpaqs available, as example:

Set-ReferenceFileSoftpaq1.01.11 -Platform 880d -os win10 -osver 21h2 -listByCategory bios,driver

Here is a partial result from the run (note the WLAN driver we will look for later):

​ 

 

With this information, we can find the Softpaq we want to remove from the Reference File and replace it with a previous version.

NOTE: this tool will only replace the existing listed Softpaq with some previous version.  It will not be able to just remove it from being listed.  Removing a Softpaq means a device driver will not be installed resulting in a bang ‘!’ in the Windows Device Manager.

 

How to replace a Softpaq with a previous version

Let’s say the Intel WLAN driver recommended in the Reference File has not been tested and qualified for the EliteBook 840 G8 in the fleet, and we want the previous version recommended by HPIA.  If all we want is just the previous version, we can let the script find it and make the change.

From the results shown above, we see the Intel WLAN driver is Softpaq sp141851, so we can run the command as follows:

  • If this is the first time we are using the script:
Set-ReferenceFileSoftpaq1.01.11 -Platform 880d -OS win10 -OSver 21h2 -ReplaceSoftpaq sp141851

At this point, the current Reference File is downloaded and cached, and a copy is made. Then, this copy is used to modify and replace the suggested Softpaq with whatever the previous version it superseded. If this was the first supported version of the Softpaq, then no changes would be made.

  • If the Reference File was cached by a previous run, add the local Reference File path option to the command:
Set-ReferenceFileSoftpaq1.01.11 -Platform 880d -OS win10 -OSver 21h2 -ReferenceFile '.\880d_64_10.0.21H2.xml' -ReplaceSoftpaq sp141851

Here we reuse the Reference File already available, and we let the script determine which Softpaq the current version superseded and make it the current version.

How to replace a Softpaq with an older version

If the Softpaq to be replaced needs to be an older version, then the -ToSoftpaq options can be used to specific which specific one to use. Here we use the -ReferenceFile option to use an existing copy of the file.

This example shows replacing an Nvidia Softpaq (
sp141851 – v22.150.0.3) with an older version (sp137116– v22.110.1.1)

Set-ReferenceFileSoftpaq1.01.11 -Platform 880d -OS win10 -OSver 21h2 -ReferenceFile '.\880d_64_10.0.21H2.xml' -ReplaceSoftpaq sp141851 -ToSoftpaq sp137116

The option -ListSuperseded can be used to find the previous versions of a particular Softpaq. So, to find the list of WLAN drivers available for this platform, the following will show all tested versions

Set-ReferenceFileSoftpaq1.01.11 -Platform 880d -OS win10 -OSver 21h2 -listsuperseded sp141851 

 

An alternative search for a Softpaq by its name is to use -listByCategory and pipe the command to a where cmdlet:

Set-ReferenceFileSoftpaq1.01.11.ps1 842a win10 2009 -ListByCategory 'driver' | where {$_ -match 'wlan'}

 

Find Softpaqs that do not supersede any other

This option (-ListNoSupersedes) searches the current Reference File for current Softpaqs that are not only the latest versions but have no previous versions tested and/or supported by the platform:

Set-ReferenceFileSoftpaq1.01.11 -Platform 880d -OS win10 -OSver 21h2 -listNoSupersedes

 

HP Image Assistant use of local reference files

When scripting HPIA, the ability to analyze a system with a local reference file – one not being downloaded from HP – was added to version 5.1.6. The /ReferenceFile:<file.xml> can be used to point to a downloaded or a customized file. In addition, the use of a local reference file also supports an offline repository with the /OfflineMode:<repo_path> option.

 

Notes on Offline Repositories

HP Image Assistant is often used in on-prem environments with an offline (inside the infrastructure) repository.  HP’s Client Management Script Library (CMSL) cmdlets are used to initialize, configure, and manage the contents of a repository.  HPIA can use the contents of a repository when run scripted with the /OfflineMode:<repo_path> option

During configuration and management of a repository, Softpaqs associated with the platforms and OS versions configured in the folder are downloaded, along their CVA (initialization files).  The CVA files contain information HPIA uses to match the system being analyzed and to find out how to install the component silently, among other information.

The CMSL commands manage the repository and attempt to maintain the latest version of each Softpaq (Invoke-RepositorySync) while removing older versions (Invoke-RepositoryCleanup).  When the script in this blog is used to modify a Reference File, a previous version of a Softpaq being recommended with the edited version may not be available on the repository (if the /OfflineMode: option is used).  Therefore, it is imperative that those Softpaqs be downloaded manually to the repository and an Invoke-RepositoryCleanup not be done, which would remove them from the folder.

Use HP CMSL cmdlets to get the Softpaq and its CVA file to the repository

Get-Softpaq <111111>

can be used to download a required Softpaq, while

Get-SoftpaqMetadataFile <111111>

i used to download the associated CVA file.