2 min read

PSADT - Dynamic* HP HotKey Support installation

So, i put together this PSADT for installing the right HP HotKey Support based on model (SystemSKU/BaseBoard).

First, download the SP's using Driver Automation Tool and the "OEM Driver Catalog" tab

This will create the files you will need, SP.exe and the setup.xml which contains supported models, intsall switches, etc:

Copy each of the "SPxxxxxx" folders into you PSADT "$dirfiles\" ("files\").

And in your PSADT .ps1 under "Installation" put this code:

		$ComputerDetails = [PSCustomObject]@{
			SystemSKU = $null
		$ComputerDetails.SystemSKU = $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace "root\WMI").BaseBoardProduct.Trim()
		$SetupXML = [PSCustomObject]@{
			SetupFile = $null
			Switches = $null
			BaseBoards = $null

		$BaseBoardFound = $null
		$SPs = Get-ChildItem "$dirfiles"

			Foreach($SP in $SPs){
					$SetupDir = "$dirfiles\$sp"        
					[xml]$XML = Get-Content "$dirfiles\$SP\Setup.xml"
					$SetupXML.BaseBoards = $XML.Settings.Models.BaseBoards
					If($SetupXML.BaseBoards -like "*$($ComputerDetails.SystemSKU)*"){
						$BaseBoardFound = $true
						$SetupXML.SetupFile = $XML.Settings.Installer.SetupFile
						$SetupXML.Switches = $XML.Settings.Installer.Switches
						$SetupXML.BaseBoards = $XML.Settings.Models.BaseBoards
				$BaseBoardFound = $false
			$BaseBoardFound -eq $true -or $BaseBoardFound -eq $false   

			$true {Execute-Process -Path "$SetupDir\$($SetupXML.SetupFile)" -Parameters "$($SetupXML.Switches)" -WindowStyle 'Hidden'}
			$false {Write-Log "No matching SystemSKU found in setup.xml's."}

What it will do is:

  • Get the SystemSKU/BaseBoard nr from the machine its beign run at, then
  • Loop through each SP folder and its respective "setup.xml" until it finds a matching value "<BaseBoards></BaseBoards>"
  • Grab the values from <SetupFile> and <Switches> and put them into variables
  • Execute-Process with those variables to install the right SP for your model.

Now, if there is a new model or SP that you need, you should just need to add another SP do $dirfiles and update the package (if you'r using CM).

You can also use the same approach for other drivers created in the same way, as they also create the "Setup.xml" (at least for the ones i've tested).