Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HPCMSL CI Detection Methods
#Detection Method for HP Client Management Script Library
(Get-WmiObject -Namespace 'root\cimv2\sms' -Query "SELECT ProductVersion FROM SMS_InstalledSoftware where ARPDisplayName like 'HP Client Management Script Library'").ProductVersion
#Detection Method for HP Model Supported on Current OS
[version]$RequiredVersion = "1.3.0"
[version]$HPCMSLVers = (Get-WmiObject -Namespace 'root\cimv2\sms' -Query "SELECT ProductVersion FROM SMS_InstalledSoftware where ARPDisplayName like 'HP Client Management Script Library'").ProductVersion
if ((Get-CimInstance -Namespace root/cimv2 -ClassName Win32_ComputerSystem).Manufacturer -like "H*"){$IsHP = $true}
if ($HPCMSLVers -ge $RequiredVersion -and $IsHP -eq $true)
{
Write-Output "HP with HPCMSL"
}
#Detection Method for HP Model Supported on Current OS
$HPCMSLVers = (Get-WmiObject -Namespace 'root\cimv2\sms' -Query "SELECT ProductVersion FROM SMS_InstalledSoftware where ARPDisplayName like 'HP Client Management Script Library'").ProductVersion
if ((Get-CimInstance -Namespace root/cimv2 -ClassName Win32_ComputerSystem).Manufacturer -like "H*"){$IsHP = $true}
if ($HPCMSLVers -ne $Null -and $IsHP -eq $true)
{
Write-Output "HP with HPCMSL"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.