-
Star
(142)
You must be signed in to star a gist -
Fork
(38)
You must be signed in to fork a gist
-
-
Save mark05e/a79221b4245962a477a49eb281d97388 to your computer and use it in GitHub Desktop.
| # ██████╗ ███████╗███╗ ███╗ ██████╗ ██╗ ██╗███████╗ ██╗ ██╗██████╗ | |
| # ██╔══██╗██╔════╝████╗ ████║██╔═══██╗██║ ██║██╔════╝ ██║ ██║██╔══██╗ | |
| # ██████╔╝█████╗ ██╔████╔██║██║ ██║██║ ██║█████╗ ███████║██████╔╝ | |
| # ██╔══██╗██╔══╝ ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔══██║██╔═══╝ | |
| # ██║ ██║███████╗██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗ ██║ ██║██║ | |
| # ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ | |
| # | |
| # ██████╗ ██╗ ██████╗ █████╗ ████████╗██╗ ██╗ █████╗ ██████╗ ███████╗ | |
| # ██╔══██╗██║ ██╔═══██╗██╔══██╗╚══██╔══╝██║ ██║██╔══██╗██╔══██╗██╔════╝ | |
| # ██████╔╝██║ ██║ ██║███████║ ██║ ██║ █╗ ██║███████║██████╔╝█████╗ | |
| # ██╔══██╗██║ ██║ ██║██╔══██║ ██║ ██║███╗██║██╔══██║██╔══██╗██╔══╝ | |
| # ██████╔╝███████╗╚██████╔╝██║ ██║ ██║ ╚███╔███╔╝██║ ██║██║ ██║███████╗ | |
| # ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | |
| # | |
| # Remove HP bloatware / crapware | |
| # | |
| # -- source : https://gist.github.com/mark05e/a79221b4245962a477a49eb281d97388 | |
| # -- contrib: francishagyard2, mark05E, erottier, JoachimBerghmans, sikkepitje | |
| # -- ref : https://community.spiceworks.com/topic/2296941-powershell-script-to-remove-windowsapps-folder?page=1#entry-9032247 | |
| # -- note : this script could use your improvements. contributions welcome! | |
| # -- todo : Wolf Security improvements ref: https://www.reddit.com/r/SCCM/comments/nru942/hp_wolf_security_how_to_remove_it/ | |
| # List of built-in apps to remove | |
| $UninstallPackages = @( | |
| "AD2F1837.HPJumpStarts" | |
| "AD2F1837.HPPCHardwareDiagnosticsWindows" | |
| "AD2F1837.HPPowerManager" | |
| "AD2F1837.HPPrivacySettings" | |
| "AD2F1837.HPSupportAssistant" | |
| "AD2F1837.HPSureShieldAI" | |
| "AD2F1837.HPSystemInformation" | |
| "AD2F1837.HPQuickDrop" | |
| "AD2F1837.HPWorkWell" | |
| "AD2F1837.myHP" | |
| "AD2F1837.HPDesktopSupportUtilities" | |
| "AD2F1837.HPQuickTouch" | |
| "AD2F1837.HPEasyClean" | |
| "AD2F1837.HPSystemInformation" | |
| ) | |
| # List of programs to uninstall | |
| $UninstallPrograms = @( | |
| "HP Client Security Manager" | |
| "HP Connection Optimizer" | |
| "HP Documentation" | |
| "HP MAC Address Manager" | |
| "HP Notifications" | |
| "HP Security Update Service" | |
| "HP System Default Settings" | |
| "HP Sure Click" | |
| "HP Sure Click Security Browser" | |
| "HP Sure Run" | |
| "HP Sure Recover" | |
| "HP Sure Sense" | |
| "HP Sure Sense Installer" | |
| "HP Wolf Security" | |
| "HP Wolf Security Application Support for Sure Sense" | |
| "HP Wolf Security Application Support for Windows" | |
| ) | |
| $HPidentifier = "AD2F1837" | |
| $InstalledPackages = Get-AppxPackage -AllUsers ` | |
| | Where-Object {($UninstallPackages -contains $_.Name) -or ($_.Name -match "^$HPidentifier")} | |
| $ProvisionedPackages = Get-AppxProvisionedPackage -Online ` | |
| | Where-Object {($UninstallPackages -contains $_.DisplayName) -or ($_.DisplayName -match "^$HPidentifier")} | |
| $InstalledPrograms = Get-Package | Where-Object {$UninstallPrograms -contains $_.Name} | |
| # Remove appx provisioned packages - AppxProvisionedPackage | |
| ForEach ($ProvPackage in $ProvisionedPackages) { | |
| Write-Host -Object "Attempting to remove provisioned package: [$($ProvPackage.DisplayName)]..." | |
| Try { | |
| $Null = Remove-AppxProvisionedPackage -PackageName $ProvPackage.PackageName -Online -ErrorAction Stop | |
| Write-Host -Object "Successfully removed provisioned package: [$($ProvPackage.DisplayName)]" | |
| } | |
| Catch {Write-Warning -Message "Failed to remove provisioned package: [$($ProvPackage.DisplayName)]"} | |
| } | |
| # Remove appx packages - AppxPackage | |
| ForEach ($AppxPackage in $InstalledPackages) { | |
| Write-Host -Object "Attempting to remove Appx package: [$($AppxPackage.Name)]..." | |
| Try { | |
| $Null = Remove-AppxPackage -Package $AppxPackage.PackageFullName -AllUsers -ErrorAction Stop | |
| Write-Host -Object "Successfully removed Appx package: [$($AppxPackage.Name)]" | |
| } | |
| Catch {Write-Warning -Message "Failed to remove Appx package: [$($AppxPackage.Name)]"} | |
| } | |
| # Remove installed programs | |
| $InstalledPrograms | ForEach-Object { | |
| Write-Host -Object "Attempting to uninstall: [$($_.Name)]..." | |
| Try { | |
| $Null = $_ | Uninstall-Package -AllVersions -Force -ErrorAction Stop | |
| Write-Host -Object "Successfully uninstalled: [$($_.Name)]" | |
| } | |
| Catch {Write-Warning -Message "Failed to uninstall: [$($_.Name)]"} | |
| } | |
| # Fallback attempt 1 to remove HP Wolf Security using msiexec | |
| Try { | |
| MsiExec /x "{0E2E04B0-9EDD-11EB-B38C-10604B96B11E}" /qn /norestart | |
| Write-Host -Object "Fallback to MSI uninistall for HP Wolf Security initiated" | |
| } | |
| Catch { | |
| Write-Warning -Object "Failed to uninstall HP Wolf Security using MSI - Error message: $($_.Exception.Message)" | |
| } | |
| # Fallback attempt 2 to remove HP Wolf Security using msiexec | |
| Try { | |
| MsiExec /x "{4DA839F0-72CF-11EC-B247-3863BB3CB5A8}" /qn /norestart | |
| Write-Host -Object "Fallback to MSI uninistall for HP Wolf 2 Security initiated" | |
| } | |
| Catch { | |
| Write-Warning -Object "Failed to uninstall HP Wolf Security 2 using MSI - Error message: $($_.Exception.Message)" | |
| } | |
| # # Uncomment this section to see what is left behind | |
| # Write-Host "Checking stuff after running script" | |
| # Write-Host "For Get-AppxPackage -AllUsers" | |
| # Get-AppxPackage -AllUsers | where {$_.Name -like "*HP*"} | |
| # Write-Host "For Get-AppxProvisionedPackage -Online" | |
| # Get-AppxProvisionedPackage -Online | where {$_.DisplayName -like "*HP*"} | |
| # Write-Host "For Get-Package" | |
| # Get-Package | select Name, FastPackageReference, ProviderName, Summary | Where {$_.Name -like "*HP*"} | Format-List | |
| # # Feature - Ask for reboot after running the script | |
| # $input = Read-Host "Restart computer now [y/n]" | |
| # switch($input){ | |
| # y{Restart-computer -Force -Confirm:$false} | |
| # n{exit} | |
| # default{write-warning "Skipping reboot."} | |
| # } |
A couple of things didn't seem to work. Here's the log when I used ImmyBot to run it:
Successfully removed provisioned package: [AD2F1837.HPDesktopSupportUtilities]
Attempting to remove provisioned package: [AD2F1837.HPPCHardwareDiagnosticsWindows]...
Successfully removed provisioned package: [AD2F1837.HPPCHardwareDiagnosticsWindows]
Attempting to remove provisioned package: [AD2F1837.HPPrivacySettings]...
Successfully removed provisioned package: [AD2F1837.HPPrivacySettings]
Attempting to remove provisioned package: [AD2F1837.HPQuickDrop]...
Successfully removed provisioned package: [AD2F1837.HPQuickDrop]
Attempting to remove provisioned package: [AD2F1837.HPSupportAssistant]...
Successfully removed provisioned package: [AD2F1837.HPSupportAssistant]
Attempting to remove provisioned package: [AD2F1837.myHP]...
Successfully removed provisioned package: [AD2F1837.myHP]
Attempting to remove Appx package: [AD2F1837.HPSupportAssistant]...
Successfully removed Appx package: [AD2F1837.HPSupportAssistant]
Attempting to remove Appx package: [AD2F1837.HPDesktopSupportUtilities]...
Successfully removed Appx package: [AD2F1837.HPDesktopSupportUtilities]
Attempting to remove Appx package: [AD2F1837.HPPrivacySettings]...
Successfully removed Appx package: [AD2F1837.HPPrivacySettings]
Attempting to remove Appx package: [AD2F1837.HPQuickDrop]...
Successfully removed Appx package: [AD2F1837.HPQuickDrop]
Attempting to remove Appx package: [AD2F1837.HPPCHardwareDiagnosticsWindows]...
Successfully removed Appx package: [AD2F1837.HPPCHardwareDiagnosticsWindows]
Attempting to remove Appx package: [AD2F1837.myHP]...
Successfully removed Appx package: [AD2F1837.myHP]
Attempting to uninstall: [HP Documentation]...
Successfully uninstalled: [HP Documentation]
Attempting to uninstall: [HP Notifications]...
Successfully uninstalled: [HP Notifications]
Attempting to uninstall: [HP System Default Settings]...
Successfully uninstalled: [HP System Default Settings]
Attempting to uninstall: [HP Connection Optimizer]...
Successfully uninstalled: [HP Connection Optimizer]
Fallback to MSI uninistall for HP Wolf Security initiated
Fallback to MSI uninistall for HP Wolf 2 Security initiated
Checking stuff after running script
For Get-AppxPackage -AllUsers
Name : RealtekSemiconductorCorp.HPAudioControl
Publisher : CN=83564403-0B26-46B8-9D84-040F43691D31
PublisherId : dt26b99r8h8gj
Architecture : X64
ResourceId :
Version : 2.31.259.0
PackageFamilyName : RealtekSemiconductorCorp.HPAudioControl_dt26b99r8h8gj
PackageFullName : RealtekSemiconductorCorp.HPAudioControl_2.31.259.0_x64__dt26b99r8h8gj
InstallLocation : C:\Program Files\WindowsApps\RealtekSemiconductorCorp.HPAudioControl_2.31.259.0_x64__dt26b99r8h8gj
IsFramework : False
PackageUserInformation : {S-1-5-18 [NT AUTHORITY\SYSTEM]: Staged}
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : False
NonRemovable : False
Dependencies : {}
IsPartiallyStaged : False
SignatureKind : Store
Status : Ok
For Get-AppxProvisionedPackage -Online
Version : 2.31.259.0
PackageName : RealtekSemiconductorCorp.HPAudioControl_2.31.259.0_neutral_~_dt26b99r8h8gj
DisplayName : RealtekSemiconductorCorp.HPAudioControl
PublisherId : dt26b99r8h8gj
MajorVersion : 2
MinorVersion : 31
Build : 259
Revision : 0
Architecture : 11
ResourceId : ~
InstallLocation : C:\Program Files\WindowsApps\RealtekSemiconductorCorp.HPAudioControl_2.31.259.0_neutral_~_dt26b99r8h8gj\AppxMetadata\AppxBundleManifest.xml
Regions : all
Path :
Online : True
WinPath :
SysDrivePath :
RestartNeeded : False
LogPath : C:\windows\Logs\DISM\dism.log
ScratchDirectory :
LogLevel : WarningsInfo
For Get-Package
Name : HP Documentation
FastPackageReference : hklm64\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\HP_Documentation
ProviderName : Programs
Summary :
Name : HP Connection Optimizer
FastPackageReference : hklm32\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6468C4A5-E47E-405F-B675-A70A70983EA6}
ProviderName : Programs
Summary :
Read-Host : Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.
At line:173 char:10
+ $input = Read-Host "Restart computer now [y/n]"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Read-Host], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.ReadHostCommand
Heads up when i run this. i still have a couple apps still installed after running and restarting.
Output
Attempting to remove provisioned package: [AD2F1837.HPEasyClean]...
Successfully removed provisioned package: [AD2F1837.HPEasyClean]
Attempting to remove provisioned package: [AD2F1837.HPPCHardwareDiagnosticsWindows]...
Successfully removed provisioned package: [AD2F1837.HPPCHardwareDiagnosticsWindows]
Attempting to remove provisioned package: [AD2F1837.HPPowerManager]...
Successfully removed provisioned package: [AD2F1837.HPPowerManager]
Attempting to remove provisioned package: [AD2F1837.HPPrivacySettings]...
Successfully removed provisioned package: [AD2F1837.HPPrivacySettings]
Attempting to remove provisioned package: [AD2F1837.HPQuickDrop]...
Successfully removed provisioned package: [AD2F1837.HPQuickDrop]
Attempting to remove provisioned package: [AD2F1837.HPSupportAssistant]...
Successfully removed provisioned package: [AD2F1837.HPSupportAssistant]
Attempting to remove provisioned package: [AD2F1837.HPSystemInformation]...
Successfully removed provisioned package: [AD2F1837.HPSystemInformation]
Attempting to remove provisioned package: [AD2F1837.myHP]...
Successfully removed provisioned package: [AD2F1837.myHP]
Attempting to remove Appx package: [AD2F1837.HPSupportAssistant]...
Successfully removed Appx package: [AD2F1837.HPSupportAssistant]
Attempting to remove Appx package: [AD2F1837.HPSystemInformation]...
Successfully removed Appx package: [AD2F1837.HPSystemInformation]
Attempting to remove Appx package: [AD2F1837.HPEasyClean]...
Successfully removed Appx package: [AD2F1837.HPEasyClean]
Attempting to remove Appx package: [AD2F1837.HPQuickDrop]...
Successfully removed Appx package: [AD2F1837.HPQuickDrop]
Attempting to remove Appx package: [AD2F1837.HPPCHardwareDiagnosticsWindows]...
Successfully removed Appx package: [AD2F1837.HPPCHardwareDiagnosticsWindows]
Attempting to remove Appx package: [AD2F1837.myHP]...
Successfully removed Appx package: [AD2F1837.myHP]
Attempting to remove Appx package: [AD2F1837.HPPowerManager]...
Successfully removed Appx package: [AD2F1837.HPPowerManager]
Attempting to remove Appx package: [AD2F1837.HPPrivacySettings]...
Successfully removed Appx package: [AD2F1837.HPPrivacySettings]
Attempting to uninstall: [HP Documentation]...
Successfully uninstalled: [HP Documentation]
Attempting to uninstall: [HP Client Security Manager]...
Successfully uninstalled: [HP Client Security Manager]
Attempting to uninstall: [HP Wolf Security]...
Successfully uninstalled: [HP Wolf Security]
Attempting to uninstall: [HP Sure Run Module]...
Successfully uninstalled: [HP Sure Run Module]
Attempting to uninstall: [HP Wolf Security Application Support for Sure Sense]...
Successfully uninstalled: [HP Wolf Security Application Support for Sure Sense]
Attempting to uninstall: [HP Notifications]...
Successfully uninstalled: [HP Notifications]
Attempting to uninstall: [HP Security Update Service]...
Successfully uninstalled: [HP Security Update Service]
Attempting to uninstall: [HP Sure Recover]...
Successfully uninstalled: [HP Sure Recover]
Attempting to uninstall: [HP System Default Settings]...
Successfully uninstalled: [HP System Default Settings]
Attempting to uninstall: [HP Connection Optimizer]...
Successfully uninstalled: [HP Connection Optimizer]
Fallback to MSI uninistall for HP Wolf Security initiated
Fallback to MSI uninistall for HP Wolf 2 Security initiated
This action is only valid for products that are currently installed.
This action is only valid for products that are currently installed.
The apps still installed are
"HP Connection Optimizer"
"HP Documentation"
"ICS"
has anyone been able to FULLY remove HP Auto Lock and Awake with this? we found that in some systems its updated to HP Presense Aware and we can get that to remove from the installed apps (as well as not showing in the power and sleep settings. However you can still search for HP Auto Lock and Awake under windows settings so somehow still has its hooks in the system . we are looking for how we can detect this and of course fully remove it. any ideas?

Looks like Connection Optimizer, HP PC Hardware Diagnostics UEFI, ICS, and Collaboration Keyboard don't remove correctly through the script.
i found this for the connection optimizer (looks like it needs an ISS file):
https://www.reddit.com/r/PowerShell/comments/mwdrvb/comment/hpcrmiu/?utm_source=share&utm_medium=web2x&context=3
Here is how i adapted it to fit into the script (i put it right before the show what's left behind section - it probably should be put in a try...):
$ConnOpt = "[InstallShield Silent]
Version=v7.00
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-DlgOrder]
Dlg0={6468C4A5-E47E-405F-B675-A70A70983EA6}-SdWelcomeMaint-0
Count=3
Dlg1={6468C4A5-E47E-405F-B675-A70A70983EA6}-MessageBox-0
Dlg2={6468C4A5-E47E-405F-B675-A70A70983EA6}-SdFinishReboot-0
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-SdWelcomeMaint-0]
Result=303
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-MessageBox-0]
Result=6
[Application]
Name=HP Connection Optimizer
Version=2.0.18.0
Company=HP Inc.
Lang=0409
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-SdFinishReboot-0]
Result=1
BootOption=0"
$ConnOpt | Out-File c:\Windows\Temp\ISS-HP.iss
&'C:\Program Files (x86)\InstallShield Installation Information\{6468C4A5-E47E-405F-B675-A70A70983EA6}\setup.exe' @('-s', '-f1C:\Windows\Temp\ISS-HP.iss')
for anyone that needs it here is my implementation of the HP Bloatware removal. This is only part of a script we use, the whole script also removes a bunch of default windows apps and more.
Hope this helps :)
$apps = @(
# HP Bloatware
"HP Connection Optimizer"
"HP Documentation"
"HP Notifications"
"HP Security Update Service"
"HP Sure Recover"
"HP Sure Run Module"
"HP Wolf Security - Console"
"HP Wolf Security"
"AD2F1837.HPEasyClean"
"AD2F1837.HPPCHardwareDiagnosticsWindows"
"AD2F1837.HPPowerManager"
"AD2F1837.HPPrivacySettings"
"AD2F1837.HPQuickDrop"
"AD2F1837.HPSupportAssistant"
"AD2F1837.HPSystemInformation"
"AD2F1837.myHP"
)
# used for uninstall of HP Connection Optimizer
# check out this for more info https://gist.github.com/mark05e/a79221b4245962a477a49eb281d97388
$ConnOpt = "[InstallShield Silent]
Version=v7.00
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-DlgOrder]
Dlg0={6468C4A5-E47E-405F-B675-A70A70983EA6}-SdWelcomeMaint-0
Count=3
Dlg1={6468C4A5-E47E-405F-B675-A70A70983EA6}-MessageBox-0
Dlg2={6468C4A5-E47E-405F-B675-A70A70983EA6}-SdFinishReboot-0
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-SdWelcomeMaint-0]
Result=303
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-MessageBox-0]
Result=6
[Application]
Name=HP Connection Optimizer
Version=2.0.18.0
Company=HP Inc.
Lang=0409
[{6468C4A5-E47E-405F-B675-A70A70983EA6}-SdFinishReboot-0]
Result=1
BootOption=0"
$appxprovisionedpackages = Get-AppxProvisionedPackage -Online
foreach ($app in $apps) {
Write-Output "Trying to remove $app"
# remove appx packages
if ((Get-AppxPackage -AllUsers).Name -eq "$app") {
Get-AppxPackage $app -AllUsers | Remove-AppxPackage -AllUsers | Out-Null
if ($?) {
Write-Host " Successfully removed AppX-Package $app"
Continue
} else {
Write-Host " Failed to remove AppX-Package $app"
Continue
}
($appxprovisionedpackages).Where( {$_.DisplayName -EQ $app}) |
Remove-AppxProvisionedPackage -Online
if (!$?) {
Write-Host " Failed to remove AppX-ProvisionedPackage $app"
} else {
Write-Host " Removed AppX-ProvisionedPackage $app"
}
Continue
}
# remove normal packages
Get-Package -Name $app -ErrorAction SilentlyContinue | Out-Null
if ($?) {
Uninstall-Package -Name $app -AllVersions -Force
if (!$?) {
Write-Host "Failed to remove $app"
} else {
# in some cases uninstall command returns a successfull but doesnt actually uninstall the Package
# https://github.com/OneGet/oneget/issues/435
# as a last effort i try to remove the Package using the UninstallString
Get-Package -Name $item -ErrorAction SilentlyContinue | Out-Null
if ($?) {
Write-Host " Couldn't remove Package due to bug. Trying via Uninstallstring..."
# remove Programms via uninstallString because Remove-Package doesnt work :(
if ($app -eq "HP Documentation") {
try {
$uninstallString = "C:\Program Files\HP\Documentation\Doc_uninstall.cmd"
Start-Process -FilePath "$uninstallString" -NoNewWindow
Write-Host " Successfully removed HP Documentation via uninstall string"
} catch {
Write-Host " Failed to remove HP Documentation via uninstall string"
}
} elseif ($app -eq "HP Connection Optimizer") {
try {
$ConnOpt | Out-File c:\Windows\Temp\ISS-HP.iss
&'C:\Program Files (x86)\InstallShield Installation Information\{6468C4A5-E47E-405F-B675-A70A70983EA6}\setup.exe' @('-s', '-f1C:\Windows\Temp\ISS-HP.iss')
Write-Host " Successfully removed HP Connection Optimizer via uninstallfile"
} catch {
Write-Host " Couldnt create uninstallfile for HP Connection Optimizer"
}
}
}
}
}
}
Great Script. Thanks. :-)
Found some more HP garbage on a actual ProBook 450 G10.
I'll leave you a few printscreens of the respective uninstall hives just in case you like to supplement it in your cleanup-script.
ICS is Charging Scheduler. Honstly i don't know if that one should be removed at all.
Edit: Just figured out that the "HP Touchpoint Analytics Client Dependencys" seems to be uninstalled together with "HP Touchpoint Analytics Client" allready.
I did a little work:
https://gist.github.com/loopyd/07a7242ece52793c29947481324822c6
Just to clean things up a bit.
Hello, nice work, can you remove bloat ware HPCaaSClientLib.dll , it keeps reinstalling itself everytime
https://community.spiceworks.com/topic/2310773-remove-all-hp-apps
C:\WINDOWS\System32\DriverStore\FileRepository\hpanalyticscomp.inf_amd64_43 ......\x64\HPCaaSClientLib.dll
Hi, here is some suggested code for handling the aggressively persistent HP spyware services..
# Uninstalling the drivers disables and (on reboot) removes the installed services.
# At this stage the only 'HP Inc.' driver we want to keep is HPSFU, used for firmware servicing.
$EvilDrivers = Get-WindowsDriver -Online | ? {$_.ProviderName -eq 'HP Inc.' -and $_.OriginalFileName -notlike '*\hpsfuservice.inf'}
$EvilDrivers | % {Write-Output "Removing driver: $($_.OriginalFileName.toString())"; pnputil /delete-driver $_.Driver /uninstall /force}
# Once the drivers are gone lets disable installation of 'drivers' for these HP 'devices' (typically automatic via Windows Update)
# SWC\HPA000C = HP Device Health Service
# SWC\HPIC000C = HP Application Enabling Services
# SWC\HPTPSH000C = HP Services Scan
# ACPI\HPIC000C = HP Application Driver
$RegistryPath = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyDeviceIDs'
If (! (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
New-ItemProperty -Path $RegistryPath -Name '1' -Value 'SWC\HPA000C' -PropertyType STRING
New-ItemProperty -Path $RegistryPath -Name '2' -Value 'SWC\HPIC000C' -PropertyType STRING
New-ItemProperty -Path $RegistryPath -Name '3' -Value 'SWC\HPTPSH000C' -PropertyType STRING
New-ItemProperty -Path $RegistryPath -Name '4' -Value 'ACPI\HPIC000C' -PropertyType STRING
$RegistryPath = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions'
New-ItemProperty -Path $RegistryPath -Name 'DenyDeviceIDs' -Value '1' -PropertyType DWORD
New-ItemProperty -Path $RegistryPath -Name 'DenyDeviceIDsRetroactive' -Value '1' -PropertyType DWORD
Hi everyone... this is an OLD thread. Please don't resurect.
By the same guy, Mark, his present script is :
Remove-HPbloatware-beta.ps1
The one posted at the bottom of the comments works quite well.
which script is valid for 2024 ? a HP EliteBook 650 15.6 inch G9 Notebook PC with Windows 11 versión 23H2
which script is valid for 2024 ? a HP EliteBook 650 15.6 inch G9 Notebook PC with Windows 11 versión 23H2
Did you even read the comment from @Netweezurd above?
Hi all,
We want to use this script with Intune, and I saw an earlier comment that this has been done with Remediation but sadly we cannot do that because you need a different License such as E3, E5, A3 or A5.
So, we created an App with the script and tested it with a laptop. When the script was done, we got a message on the device if you are sure to remove HP Support Assistant (Can you force this?) and a lot of other HP Bloatware was still installed such as HP Wolf Security. We also kept getting messages about Can’t install ‘Script name’
We used the original Remove-HPbloatware.ps1 script. Is this the best option if you can’t do it with Remediation? And what is the best way to detect the script (To look for a File or with a detection script)?
We recently onboarded a new client who have some windows 8 era HP AIOs and found a few more applications and packages that weren't accounted for in the current iteration. This script seems more targeted to new HP deployments, but is equally useful for old deployments that still have the bloat present.
I have not run the script yet with the modifications, but here's our current list. I realize this is for HP bloatware, but I've included Mcafee, wildtangent, and candy crush as well.
# List of built-in apps to remove
$UninstallPackages = @(
"AD2F1837.HPJumpStarts"
"AD2F1837.HPPCHardwareDiagnosticsWindows"
"AD2F1837.HPPowerManager"
"AD2F1837.HPPrivacySettings"
"AD2F1837.HPSupportAssistant"
"AD2F1837.HPSureShieldAI"
"AD2F1837.HPSystemInformation"
"AD2F1837.HPQuickDrop"
"AD2F1837.HPWorkWell"
"AD2F1837.myHP"
"AD2F1837.HPDesktopSupportUtilities"
"AD2F1837.HPQuickTouch"
"AD2F1837.HPEasyClean"
"AD2F1837.HPSystemInformation"
"AD2F1837.HPConnectedMusic"
"AD2F1837.HPFileViewer"
"AD2F1837.HPRegistration"
"AD2F1837.HPWelcome"
"AD2F1837.HPConnectedPhotopoweredbySnapfish"
"AD2F1837.HPPrinterControl"
"king.com.CandyCrushSodaSaga"
)
# List of programs to uninstall
$UninstallPrograms = @(
"HP Connection Optimizer"
"HP Documentation"
"HP Dropbox Plugin"
"HP EmailSMTP Plugin"
"HP ePrint SW"
"HP FTP Plugin"
"HP Google Drive Plugin"
"HP JumpStart Apps"
"HP JumpStart Bridge"
"HP JumpStart Launch"
"HP MAC Address Manager"
"HP Notifications"
"HP OneDrive Plugin"
"HP PC Hardware Diagnostics Windows"
"HP Scan Twain"
"HP SFTP Plugin"
"HP SharePoint Plugin"
"HP Support Solutions Framework"
"HP System Event Utility"
"HP System Info HSA Service"
"HP Security Update Service"
"HP System Default Settings"
"HP Sure Click"
"HP Sure Click Security Browser"
"HP Sure Run"
"HP Sure Run Module"
"HP Sure Recover"
"HP Sure Sense"
"HP Sure Sense Installer"
"HP Wolf Security"
"HP Wolf Security - Console"
"HP Wolf Security Application Support for Sure Sense"
"HP Wolf Security Application Support for Windows"
"McAfee Security Scan Plus"
"WebAdvisor by McAfee"
"WildTangent Games"
)
Hi!
When we run this script everything will be deleted and not reinstalled but Wolf security.
Anyone has the same issue? If so anyone has a clue how to fix it?
Hi!
When we run this script everything will be deleted and not reinstalled but Wolf security. Anyone has the same issue? If so anyone has a clue how to fix it?
It used to be another HP service like "HP Sure Sense" which silently reinstalled Wolf. If this specific software is still the case, I'm not sure.
We bought our laptops in bulk (well, 80 pcs) so we got the option from our distributer to have them delivered without (HP) bloatware.
Anyway, you now should at least have a direction to search in. Good luck!
Hi!
When we run this script everything will be deleted and not reinstalled but Wolf security. Anyone has the same issue? If so anyone has a clue how to fix it?It used to be another HP service like "HP Sure Sense" which silently reinstalled Wolf. If this specific software is still the case, I'm not sure. We bought our laptops in bulk (well, 80 pcs) so we got the option from our distributer to have them delivered without (HP) bloatware.
Anyway, you now should at least have a direction to search in. Good luck!
Hi Erottier,
We already got it working, with a bit of thinking and a bit of GPT we made a script that removes all. And also logs if the script has failed or succesfully ran.
Hi!
When we run this script everything will be deleted and not reinstalled but Wolf security. Anyone has the same issue? If so anyone has a clue how to fix it?It used to be another HP service like "HP Sure Sense" which silently reinstalled Wolf. If this specific software is still the case, I'm not sure. We bought our laptops in bulk (well, 80 pcs) so we got the option from our distributer to have them delivered without (HP) bloatware.
Anyway, you now should at least have a direction to search in. Good luck!Hi Erottier,
We already got it working, with a bit of thinking and a bit of GPT we made a script that removes all. And also logs if the script has failed or succesfully ran.
Can you maybe share the script?
Hi!
When we run this script everything will be deleted and not reinstalled but Wolf security. Anyone has the same issue? If so anyone has a clue how to fix it?It used to be another HP service like "HP Sure Sense" which silently reinstalled Wolf. If this specific software is still the case, I'm not sure. We bought our laptops in bulk (well, 80 pcs) so we got the option from our distributer to have them delivered without (HP) bloatware.
Anyway, you now should at least have a direction to search in. Good luck!Hi Erottier,
We already got it working, with a bit of thinking and a bit of GPT we made a script that removes all. And also logs if the script has failed or succesfully ran.Can you maybe share the script?
@MrBaas073: it will be cool and helpful :-)
Based on the original script (thank you very much), I used GPT to customize a version for our environment and needs that works well. For anyone who is interested:
Short Summary
This script removes unwanted HP software, services, and scheduled tasks from HP Windows devices while keeping all components needed for Support Assistant and hardware diagnostics.
It is designed for Intune deployment and includes a detection tag file.
🎯 What the Script Removes
HP bloatware AppX packages (JumpStarts, QuickDrop, WorkWell, myHP, EasyClean, etc.)
Classic HP programs, including
HP Wolf Security + components
HP Sure Click / Sure Sense / Sure Run / Sure Recover
HP Client Security Manager
HP Notifications / Security Update Service / Default Settings
HP MAC Address Manager
Poly Lens
HP Insights stack, including
HP Insights (MSI)
Insights Agent / WatchDog / Analytics / Audio Analytics
HP Touchpoint Analytics Client
HP Connection Optimizer (via correct silent InstallShield uninstall)
HP Documentation (via HP's uninstall CMD)
Leftover Start Menu shortcuts (HP Documentation, Miro Offer, TCO Certified)
Registry leftovers for Connection Optimizer & Documentation
🔥 HP Insights doesn’t come back
The script removes every mechanism that HP uses to auto-reinstall Insights:
HP Services Scan
Insights Agent / Analytics / WatchDog services
Scheduled tasks under \HP* and \Hewlett-Packard\HP Wolf Security*
Empty HP task folders
This ensures Insights cannot return after removal.
🧩 What the Script Keeps
To avoid breaking support workflows:
HP Support Assistant
HP PC Hardware Diagnostics
All HSA Servises needed by Support Assistant
HP Hotkey UWP Service
HP LAN/WLAN/WWAN Switching UWP Service
These are required for diagnostics, Fn-keys, and network switching.
script, there you go
<#
Remove HP Bloatware / HP Insights / Connection Optimizer / Documentation
For Intune (detection via tag file)
Keeps:
- HP Support Assistant
- HP PC Hardware Diagnostics Windows
- all *HSA Service* services (App Helper / Diagnostics / Network / System Info)
- HP Hotkey UWP Service
- HP LAN/WLAN/WWAN Switching UWP Service
#>
[CmdletBinding()]
param()
$ErrorActionPreference = "Continue"
Write-Host "===== Starting HP cleanup ====="
# --------------------------------------------------------------------
# 0) Helper function: uninstall programs via registry Uninstall keys
# (only used for Insights / Touchpoint, NOT for Support Assistant)
# --------------------------------------------------------------------
function Invoke-RegistryUninstall {
param(
[string[]]$Patterns
)
$roots = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
)
foreach ($root in $roots) {
Get-ChildItem $root -ErrorAction SilentlyContinue | ForEach-Object {
$props = Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue
if (-not $props.DisplayName) { continue }
foreach ($pattern in $Patterns) {
if ($props.DisplayName -like $pattern) {
# explicitly protected programs
if ($props.DisplayName -like "*Support Assistant*" -or
$props.DisplayName -like "*PC Hardware Diagnostics*") {
continue
}
$name = $props.DisplayName
$uninstallString = $props.UninstallString
$key = $_.PSChildName
Write-Host ">>> Registry uninstall for: $name"
Write-Host " UninstallString: $uninstallString"
try {
# 1) MSI GUID as key name
if ($key -match "^\{[0-9A-Fa-f\-]{36}\}$") {
Start-Process "msiexec.exe" -ArgumentList "/X$key /qn /norestart" -Wait
Write-Host " -> removed (GUID key)."
continue
}
# 2) MSI via UninstallString
if ($uninstallString -match "msiexec\.exe") {
if ($uninstallString -match "\{[0-9A-Fa-f\-]{36}\}") {
$guid = $Matches[0]
Start-Process "msiexec.exe" -ArgumentList "/X$guid /qn /norestart" -Wait
Write-Host " -> removed (GUID in string)."
continue
}
}
# 3) normal EXE setup
if ($uninstallString) {
if ($uninstallString.StartsWith('"')) {
$exe = $uninstallString.Split('"')[1]
$args = $uninstallString.Substring($exe.Length + 2).Trim()
} else {
$exe = $uninstallString.Split(" ")[0]
$args = $uninstallString.Substring($exe.Length).Trim()
}
if ($args -notmatch "/quiet" -and $args -notmatch "/s") {
$args += " /quiet /norestart"
}
Start-Process $exe -ArgumentList $args -Wait
Write-Host " -> removed (EXE)."
}
}
catch {
Write-Warning " Error during uninstall: $($_.Exception.Message)"
}
}
}
}
}
}
# --------------------------------------------------------------------
# 1) Remove AppX and provisioned packages (keep Support Assistant, HW Diagnostics)
# --------------------------------------------------------------------
$UninstallPackages = @(
"AD2F1837.HPJumpStarts"
# "AD2F1837.HPPCHardwareDiagnosticsWindows" # AppX, desktop variant is kept
"AD2F1837.HPPowerManager"
"AD2F1837.HPPrivacySettings"
# "AD2F1837.HPSupportAssistant" # if it must be kept
"AD2F1837.HPSureShieldAI"
"AD2F1837.HPSystemInformation"
"AD2F1837.HPQuickDrop"
"AD2F1837.HPWorkWell"
"AD2F1837.myHP"
"AD2F1837.HPDesktopSupportUtilities"
"AD2F1837.HPQuickTouch"
"AD2F1837.HPEasyClean"
"AD2F1837.HPSystemInformation"
"AD2F1837.11510256BE195"
)
Write-Host "Removing HP AppX / provisioned packages…"
$InstalledAppx = Get-AppxPackage -AllUsers | Where-Object { $UninstallPackages -contains $_.Name }
$ProvAppx = Get-AppxProvisionedPackage -Online | Where-Object { $UninstallPackages -contains $_.DisplayName }
foreach ($p in $ProvAppx) {
Write-Host " Provisioned: $($p.DisplayName)"
try {
Remove-AppxProvisionedPackage -Online -PackageName $p.PackageName | Out-Null
} catch {}
}
foreach ($p in $InstalledAppx) {
Write-Host " AppX: $($p.Name)"
try {
Remove-AppxPackage -Package $p.PackageFullName -AllUsers | Out-Null
} catch {}
}
# --------------------------------------------------------------------
# 2) Programs via Get-Package (HP Wolf, Sure*, etc.)
# --------------------------------------------------------------------
Write-Host "Removing defined HP programs (Get-Package)…"
$UninstallPrograms = @(
"HP Client Security Manager"
"HP Connection Optimizer" # additionally handled explicitly
"HP Documentation" # additionally handled explicitly
"HP MAC Address Manager"
"HP Notifications"
"HP Security Update Service"
"HP System Default Settings"
"HP Sure Click"
"HP Sure Click Security Browser"
"HP Sure Run"
"HP Sure Recover"
"HP Sure Sense"
"HP Sure Sense Installer"
"HP Wolf Security"
"HP Wolf Security Application Support for Sure Sense"
"HP Wolf Security Application Support for Windows"
"Poly Lens"
"HP Insights"
"HP Insights Agent"
"HP Insights Analytics"
"HP Insights WatchDog Service"
"HP Touchpoint Analytics Client"
)
$pattern = ($UninstallPrograms | ForEach-Object { [Regex]::Escape($_) }) -join "|"
$InstalledPrograms = Get-Package -ErrorAction SilentlyContinue | Where-Object {
$_.Name -match $pattern
}
foreach ($pkg in $InstalledPrograms) {
Write-Host " Get-Package uninstall: $($pkg.Name)"
try {
$pkg | Uninstall-Package -AllVersions -Force -ErrorAction Stop | Out-Null
} catch {
Write-Warning " Error: $($_.Exception.Message)"
}
}
# --------------------------------------------------------------------
# 3) Fallback via Win32_Product (slow, but okay one-time)
# --------------------------------------------------------------------
Write-Host "Searching additional HP programs via Win32_Product…"
$appList = Get-WmiObject -Class Win32_Product -ErrorAction SilentlyContinue | Where-Object {
($_.Name -like '*HP Wolf Security*') -or
($_.Name -like '*Poly Lens*') -or
($_.Name -like '*HP Sure Recover*') -or
($_.Name -match 'ICS') -or
($_.Name -like '*HP Security Update Service*') -or
($_.Name -like '*HP Notifications*') -or
($_.Name -like '*HP Connection Optimizer*') -or
($_.Name -like '*HP Documentation*') -or
($_.Name -like '*HP Insights*') -or
($_.Name -like '*HP Touchpoint Analytics*')
}
foreach ($app in $appList) {
Write-Host " Win32_Product uninstall: $($app.Name)"
try {
$null = $app.Uninstall()
} catch {
Write-Warning " Error: $($_.Exception.Message)"
}
}
# --------------------------------------------------------------------
# 4) MSI fallbacks (Wolf Security & old Connection Optimizer GUID)
# --------------------------------------------------------------------
Write-Host "Running MSI fallback uninstallers…"
$wolfGuids = @(
"{0E2E04B0-9EDD-11EB-B38C-10604B96B11E}",
"{4DA839F0-72CF-11EC-B247-3863BB3CB5A8}"
)
foreach ($guid in $wolfGuids) {
try {
Start-Process "msiexec.exe" -ArgumentList "/X$guid /qn /norestart" -Wait -ErrorAction Stop
Write-Host " Wolf Security GUID removed: $guid"
} catch {}
}
try {
# if this old MSI version is present
Start-Process "msiexec.exe" -ArgumentList "/X{FCC74B77-EC3E-4DD8-A80B-008A702075A9} /qn /norestart" -Wait -ErrorAction SilentlyContinue
Write-Host " HP Connection Optimizer (MSI GUID) removed (if present)."
} catch {}
# --------------------------------------------------------------------
# 5) HP Connection Optimizer – exact InstallShield uninstall
# --------------------------------------------------------------------
Write-Host "HP Connection Optimizer (InstallShield)…"
$coExe = "C:\Program Files (x86)\InstallShield Installation Information\{6468C4A5-E47E-405F-B675-A70A70983EA6}\setup.exe"
if (Test-Path $coExe) {
try {
$args = "-runfromtemp -l0x0407 -removeonly /s"
Write-Host " -> $coExe $args"
Start-Process $coExe -ArgumentList $args -Wait -ErrorAction Stop
Write-Host " -> HP Connection Optimizer uninstalled."
}
catch {
Write-Warning " -> Error uninstalling HP Connection Optimizer: $($_.Exception.Message)"
}
} else {
Write-Host " HP Connection Optimizer setup.exe not found – maybe already removed."
}
# --------------------------------------------------------------------
# 6) HP Documentation – exact CMD uninstall
# --------------------------------------------------------------------
Write-Host "HP Documentation…"
$docCmd = "C:\Program Files\HP\Documentation\Doc_Uninstall.cmd"
if (Test-Path $docCmd) {
try {
Start-Process "cmd.exe" -ArgumentList "/c `"$docCmd`"" -Wait -ErrorAction Stop
Write-Host " -> HP Documentation uninstalled."
}
catch {
Write-Warning " -> Error uninstalling HP Documentation: $($_.Exception.Message)"
}
} else {
Write-Host " HP Documentation not found – maybe already removed."
}
# --------------------------------------------------------------------
# 7) HP Insights – proper MSI uninstall (instead of /I)
# --------------------------------------------------------------------
Write-Host "HP Insights (MSI)…"
$insightsGuid = "{B1C44EC2-0AB5-4777-9EAF-532196758090}"
try {
Start-Process "msiexec.exe" -ArgumentList "/X$insightsGuid /qn /norestart" -Wait -ErrorAction Stop
Write-Host " -> HP Insights uninstalled."
}
catch {
Write-Warning " -> Error uninstalling HP Insights: $($_.Exception.Message)"
}
# additionally try to catch other Insights / Touchpoint variants
Invoke-RegistryUninstall -Patterns @(
"*HP Insights*",
"*HP Touchpoint Analytics*"
)
# --------------------------------------------------------------------
# 8) Remove HP Insights / Analytics / auto-installer services
# (Support Assistant & all *HSA Service* are kept!)
# --------------------------------------------------------------------
Write-Host "Cleaning up HP Insights-related services…"
# 8.1 Exact, safe service names:
$hpInsightsServiceNames = @(
"HP Services Scan",
"HP Insights Agent",
"HP Insights WatchDog Service",
"HP Audio Analytics Service"
)
foreach ($svcName in $hpInsightsServiceNames) {
$svc = Get-Service -Name $svcName -ErrorAction SilentlyContinue
if ($null -ne $svc) {
Write-Host " Exact: stopping and deleting $($svc.DisplayName)"
try {
if ($svc.Status -ne "Stopped") {
Stop-Service -Name $svc.Name -Force -ErrorAction SilentlyContinue
}
sc.exe delete "$($svc.Name)" | Out-Null
} catch {
Write-Warning " Error removing service $($svc.DisplayName): $($_.Exception.Message)"
}
}
}
# 8.2 Pattern-based cleanup (without touching HSA / hotkey / switching services)
$hpSvcPatterns = @(
"*Insights*",
"*Touchpoint*",
"*Audio Analytics*"
)
$protectedPatterns = @(
"*HSA Service*", # keep all HSA services
"*Support Assistant*", # in case of a dedicated service
"*Hotkey UWP Service*",
"*LAN/WLAN/WWAN Switching UWP Service*"
)
foreach ($svc in Get-Service -ErrorAction SilentlyContinue) {
$name = $svc.DisplayName
if (-not $name) { continue }
# protection: services that must never be removed
$isProtected = $false
foreach ($pp in $protectedPatterns) {
if ($name -like $pp) {
$isProtected = $true
break
}
}
if ($isProtected) { continue }
foreach ($pat in $hpSvcPatterns) {
if ($name -like $pat) {
Write-Host " Pattern: stopping and deleting $name"
try {
if ($svc.Status -ne "Stopped") {
Stop-Service -Name $svc.Name -Force -ErrorAction SilentlyContinue
}
sc.exe delete "$($svc.Name)" | Out-Null
} catch {
Write-Warning " Error removing service $($name): $($_.Exception.Message)"
}
break
}
}
}
# --------------------------------------------------------------------
# 9) Clean up HP scheduled tasks
# - remove unwanted HP tasks
# - remove empty HP task folders
# --------------------------------------------------------------------
Write-Host "Cleaning up HP scheduled tasks…"
# Which task names should be removed?
$hpTaskNamePatternsToRemove = @(
"*HP Insights*",
"*Touchpoint*",
"*Analytics*",
"Consent Manager Launcher"
)
# Which task paths should be cleaned up?
$hpTaskPathPatternsToRemove = @(
"\HP\*",
"\Hewlett-Packard\HP Wolf Security\*"
)
# Which tasks/folders must be kept?
$hpTaskProtectedPatterns = @(
"*Support Assistant*"
)
# 9.1 Remove tasks
$allTasks = Get-ScheduledTask -ErrorAction SilentlyContinue
foreach ($task in $allTasks) {
$remove = $false
# match by task name
foreach ($p in $hpTaskNamePatternsToRemove) {
if ($task.TaskName -like $p) {
$remove = $true
break
}
}
# match by task path (if not already decided)
if (-not $remove) {
foreach ($p in $hpTaskPathPatternsToRemove) {
if ($task.TaskPath -like $p) {
$remove = $true
break
}
}
}
if (-not $remove) { continue }
# protection: keep any Support Assistant tasks
$protected = $false
foreach ($p in $hpTaskProtectedPatterns) {
if ($task.TaskName -like $p -or $task.TaskPath -like "*Support Assistant*") {
$protected = $true
break
}
}
if ($protected) { continue }
Write-Host " Removing HP task: $($task.TaskPath)$($task.TaskName)"
try {
Unregister-ScheduledTask -TaskName $task.TaskName -TaskPath $task.TaskPath -Confirm:$false
}
catch {
Write-Warning " Error removing task $($task.TaskPath)$($task.TaskName): $($_.Exception.Message)"
}
}
# 9.2 Recursively remove empty HP task folders
Write-Host "Cleaning up empty HP task folders…"
function Remove-EmptyTaskFolderRecursive {
param(
[Parameter(Mandatory)][string]$FolderPath,
[Parameter(Mandatory)]$Service
)
try {
$folder = $Service.GetFolder($FolderPath)
}
catch {
# folder does not exist -> nothing to do
return
}
# first process subfolders (bottom-up)
foreach ($sub in @($folder.GetFolders(0))) {
Remove-EmptyTaskFolderRecursive -FolderPath $sub.Path -Service $Service
}
# now check if this folder is empty
$hasTasks = ($folder.GetTasks(1).Count -gt 0)
$hasFolders = ($folder.GetFolders(1).Count -gt 0)
if (-not $hasTasks -and -not $hasFolders -and $FolderPath -ne "\") {
$parentPath = Split-Path $FolderPath
if ([string]::IsNullOrWhiteSpace($parentPath)) { $parentPath = "\" }
$name = Split-Path $FolderPath -Leaf
Write-Host " Removing empty folder: $FolderPath"
try {
$parent = $Service.GetFolder($parentPath)
$parent.DeleteFolder($name, 0)
}
catch {
Write-Warning " Error deleting folder $($FolderPath): $($_.Exception.Message)"
}
}
}
try {
$service = New-Object -ComObject "Schedule.Service"
$service.Connect()
# roots we want to clean up
foreach ($rootPath in @("\HP", "\Hewlett-Packard\HP Wolf Security")) {
Remove-EmptyTaskFolderRecursive -FolderPath $rootPath -Service $service
}
}
catch {
Write-Warning " Error accessing Task Scheduler (COM): $($_.Exception.Message)"
}
# --------------------------------------------------------------------
# 10) Remove leftover uninstall registry entries for
# HP Connection Optimizer & HP Documentation
# --------------------------------------------------------------------
Write-Host "Cleaning uninstall registry entries for HP Connection Optimizer / HP Documentation…"
$hpCleanupPatterns = @(
"*HP Connection Optimizer*",
"*HP Documentation*"
)
$uninstallRoots = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
)
foreach ($root in $uninstallRoots) {
Get-ChildItem -Path $root -ErrorAction SilentlyContinue | ForEach-Object {
try {
$props = Get-ItemProperty -Path $_.PSPath -ErrorAction SilentlyContinue
} catch { continue }
if (-not $props.DisplayName) { continue }
foreach ($pattern in $hpCleanupPatterns) {
if ($props.DisplayName -like $pattern) {
Write-Host " Deleting uninstall key: '$($props.DisplayName)'"
Write-Host " Path: $($_.PSPath)"
try {
Remove-Item -Path $_.PSPath -Recurse -Force -ErrorAction Stop
} catch {
Write-Warning " Error deleting uninstall key: $($_.Exception.Message)"
}
}
}
}
}
# --------------------------------------------------------------------
# 11) Remove start menu shortcuts (HP Documentation / Miro Offer / TCO Certified)
# --------------------------------------------------------------------
Write-Host "Cleaning start menu shortcuts…"
$shortcutNames = @(
"HP Documentation",
"Miro Offer",
"TCO Certified"
)
$programsPath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"
foreach ($name in $shortcutNames) {
# find .lnk files with matching base name
$lnks = Get-ChildItem -Path $programsPath -Recurse -ErrorAction SilentlyContinue `
| Where-Object {
-not $_.PSIsContainer -and
$_.Extension -eq ".lnk" -and
$_.BaseName -like "$name*"
}
foreach ($lnk in $lnks) {
Write-Host " Removing shortcut: $($lnk.FullName)"
try {
Remove-Item -Path $lnk.FullName -Force -ErrorAction Stop
}
catch {
Write-Warning " Error deleting $($lnk.FullName): $($_.Exception.Message)"
}
}
# remove matching start menu folders if present
$dirs = Get-ChildItem -Path $programsPath -Recurse -Directory -ErrorAction SilentlyContinue `
| Where-Object { $_.Name -like "$name*" }
foreach ($dir in $dirs) {
Write-Host " Removing start menu folder: $($dir.FullName)"
try {
Remove-Item -Path $dir.FullName -Recurse -Force -ErrorAction Stop
}
catch {
Write-Warning " Error deleting folder $($dir.FullName): $($_.Exception.Message)"
}
}
}
# --------------------------------------------------------------------
# 12) Tag file for Intune detection rule
# --------------------------------------------------------------------
Write-Host "Creating Intune tag file…"
$tagFolder = "$env:ProgramData\Microsoft\RemoveHPBloatware"
$tagFile = Join-Path $tagFolder "hpbloatware_uninstall.ps1.tag"
if (-not (Test-Path $tagFolder)) {
New-Item -ItemType Directory -Path $tagFolder -Force | Out-Null
}
Set-Content -Path $tagFile -Value "Installed" -Force
Write-Host "Tag file: $tagFile"
Write-Host "===== HP cleanup finished ====="
Exit 0Based on the original script (thank you very much), I used GPT to customize a version for our environment and needs that works well. For anyone who is interested:
Short Summary
This script removes unwanted HP software, services, and scheduled tasks from HP Windows devices while keeping all components needed for Support Assistant and hardware diagnostics. It is designed for Intune deployment and includes a detection tag file.
🎯 What the Script Removes HP bloatware AppX packages (JumpStarts, QuickDrop, WorkWell, myHP, EasyClean, etc.)
Classic HP programs, including HP Wolf Security + components HP Sure Click / Sure Sense / Sure Run / Sure Recover HP Client Security Manager HP Notifications / Security Update Service / Default Settings HP MAC Address Manager Poly Lens HP Insights stack, including HP Insights (MSI) Insights Agent / WatchDog / Analytics / Audio Analytics HP Touchpoint Analytics Client HP Connection Optimizer (via correct silent InstallShield uninstall) HP Documentation (via HP's uninstall CMD)
Leftover Start Menu shortcuts (HP Documentation, Miro Offer, TCO Certified) Registry leftovers for Connection Optimizer & Documentation
🔥 HP Insights doesn’t come back The script removes every mechanism that HP uses to auto-reinstall Insights: HP Services Scan Insights Agent / Analytics / WatchDog services Scheduled tasks under \HP* and \Hewlett-Packard\HP Wolf Security* Empty HP task folders
This ensures Insights cannot return after removal.
🧩 What the Script Keeps To avoid breaking support workflows: HP Support Assistant HP PC Hardware Diagnostics All HSA Servises needed by Support Assistant HP Hotkey UWP Service HP LAN/WLAN/WWAN Switching UWP Service
These are required for diagnostics, Fn-keys, and network switching.
script, there you go
<# Remove HP Bloatware / HP Insights / Connection Optimizer / Documentation For Intune (detection via tag file) Keeps: - HP Support Assistant - HP PC Hardware Diagnostics Windows - all *HSA Service* services (App Helper / Diagnostics / Network / System Info) - HP Hotkey UWP Service - HP LAN/WLAN/WWAN Switching UWP Service #> [CmdletBinding()] param() $ErrorActionPreference = "Continue" Write-Host "===== Starting HP cleanup =====" # -------------------------------------------------------------------- # 0) Helper function: uninstall programs via registry Uninstall keys # (only used for Insights / Touchpoint, NOT for Support Assistant) # -------------------------------------------------------------------- function Invoke-RegistryUninstall { param( [string[]]$Patterns ) $roots = @( "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ) foreach ($root in $roots) { Get-ChildItem $root -ErrorAction SilentlyContinue | ForEach-Object { $props = Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue if (-not $props.DisplayName) { continue } foreach ($pattern in $Patterns) { if ($props.DisplayName -like $pattern) { # explicitly protected programs if ($props.DisplayName -like "*Support Assistant*" -or $props.DisplayName -like "*PC Hardware Diagnostics*") { continue } $name = $props.DisplayName $uninstallString = $props.UninstallString $key = $_.PSChildName Write-Host ">>> Registry uninstall for: $name" Write-Host " UninstallString: $uninstallString" try { # 1) MSI GUID as key name if ($key -match "^\{[0-9A-Fa-f\-]{36}\}$") { Start-Process "msiexec.exe" -ArgumentList "/X$key /qn /norestart" -Wait Write-Host " -> removed (GUID key)." continue } # 2) MSI via UninstallString if ($uninstallString -match "msiexec\.exe") { if ($uninstallString -match "\{[0-9A-Fa-f\-]{36}\}") { $guid = $Matches[0] Start-Process "msiexec.exe" -ArgumentList "/X$guid /qn /norestart" -Wait Write-Host " -> removed (GUID in string)." continue } } # 3) normal EXE setup if ($uninstallString) { if ($uninstallString.StartsWith('"')) { $exe = $uninstallString.Split('"')[1] $args = $uninstallString.Substring($exe.Length + 2).Trim() } else { $exe = $uninstallString.Split(" ")[0] $args = $uninstallString.Substring($exe.Length).Trim() } if ($args -notmatch "/quiet" -and $args -notmatch "/s") { $args += " /quiet /norestart" } Start-Process $exe -ArgumentList $args -Wait Write-Host " -> removed (EXE)." } } catch { Write-Warning " Error during uninstall: $($_.Exception.Message)" } } } } } } # -------------------------------------------------------------------- # 1) Remove AppX and provisioned packages (keep Support Assistant, HW Diagnostics) # -------------------------------------------------------------------- $UninstallPackages = @( "AD2F1837.HPJumpStarts" # "AD2F1837.HPPCHardwareDiagnosticsWindows" # AppX, desktop variant is kept "AD2F1837.HPPowerManager" "AD2F1837.HPPrivacySettings" # "AD2F1837.HPSupportAssistant" # if it must be kept "AD2F1837.HPSureShieldAI" "AD2F1837.HPSystemInformation" "AD2F1837.HPQuickDrop" "AD2F1837.HPWorkWell" "AD2F1837.myHP" "AD2F1837.HPDesktopSupportUtilities" "AD2F1837.HPQuickTouch" "AD2F1837.HPEasyClean" "AD2F1837.HPSystemInformation" "AD2F1837.11510256BE195" ) Write-Host "Removing HP AppX / provisioned packages…" $InstalledAppx = Get-AppxPackage -AllUsers | Where-Object { $UninstallPackages -contains $_.Name } $ProvAppx = Get-AppxProvisionedPackage -Online | Where-Object { $UninstallPackages -contains $_.DisplayName } foreach ($p in $ProvAppx) { Write-Host " Provisioned: $($p.DisplayName)" try { Remove-AppxProvisionedPackage -Online -PackageName $p.PackageName | Out-Null } catch {} } foreach ($p in $InstalledAppx) { Write-Host " AppX: $($p.Name)" try { Remove-AppxPackage -Package $p.PackageFullName -AllUsers | Out-Null } catch {} } # -------------------------------------------------------------------- # 2) Programs via Get-Package (HP Wolf, Sure*, etc.) # -------------------------------------------------------------------- Write-Host "Removing defined HP programs (Get-Package)…" $UninstallPrograms = @( "HP Client Security Manager" "HP Connection Optimizer" # additionally handled explicitly "HP Documentation" # additionally handled explicitly "HP MAC Address Manager" "HP Notifications" "HP Security Update Service" "HP System Default Settings" "HP Sure Click" "HP Sure Click Security Browser" "HP Sure Run" "HP Sure Recover" "HP Sure Sense" "HP Sure Sense Installer" "HP Wolf Security" "HP Wolf Security Application Support for Sure Sense" "HP Wolf Security Application Support for Windows" "Poly Lens" "HP Insights" "HP Insights Agent" "HP Insights Analytics" "HP Insights WatchDog Service" "HP Touchpoint Analytics Client" ) $pattern = ($UninstallPrograms | ForEach-Object { [Regex]::Escape($_) }) -join "|" $InstalledPrograms = Get-Package -ErrorAction SilentlyContinue | Where-Object { $_.Name -match $pattern } foreach ($pkg in $InstalledPrograms) { Write-Host " Get-Package uninstall: $($pkg.Name)" try { $pkg | Uninstall-Package -AllVersions -Force -ErrorAction Stop | Out-Null } catch { Write-Warning " Error: $($_.Exception.Message)" } } # -------------------------------------------------------------------- # 3) Fallback via Win32_Product (slow, but okay one-time) # -------------------------------------------------------------------- Write-Host "Searching additional HP programs via Win32_Product…" $appList = Get-WmiObject -Class Win32_Product -ErrorAction SilentlyContinue | Where-Object { ($_.Name -like '*HP Wolf Security*') -or ($_.Name -like '*Poly Lens*') -or ($_.Name -like '*HP Sure Recover*') -or ($_.Name -match 'ICS') -or ($_.Name -like '*HP Security Update Service*') -or ($_.Name -like '*HP Notifications*') -or ($_.Name -like '*HP Connection Optimizer*') -or ($_.Name -like '*HP Documentation*') -or ($_.Name -like '*HP Insights*') -or ($_.Name -like '*HP Touchpoint Analytics*') } foreach ($app in $appList) { Write-Host " Win32_Product uninstall: $($app.Name)" try { $null = $app.Uninstall() } catch { Write-Warning " Error: $($_.Exception.Message)" } } # -------------------------------------------------------------------- # 4) MSI fallbacks (Wolf Security & old Connection Optimizer GUID) # -------------------------------------------------------------------- Write-Host "Running MSI fallback uninstallers…" $wolfGuids = @( "{0E2E04B0-9EDD-11EB-B38C-10604B96B11E}", "{4DA839F0-72CF-11EC-B247-3863BB3CB5A8}" ) foreach ($guid in $wolfGuids) { try { Start-Process "msiexec.exe" -ArgumentList "/X$guid /qn /norestart" -Wait -ErrorAction Stop Write-Host " Wolf Security GUID removed: $guid" } catch {} } try { # if this old MSI version is present Start-Process "msiexec.exe" -ArgumentList "/X{FCC74B77-EC3E-4DD8-A80B-008A702075A9} /qn /norestart" -Wait -ErrorAction SilentlyContinue Write-Host " HP Connection Optimizer (MSI GUID) removed (if present)." } catch {} # -------------------------------------------------------------------- # 5) HP Connection Optimizer – exact InstallShield uninstall # -------------------------------------------------------------------- Write-Host "HP Connection Optimizer (InstallShield)…" $coExe = "C:\Program Files (x86)\InstallShield Installation Information\{6468C4A5-E47E-405F-B675-A70A70983EA6}\setup.exe" if (Test-Path $coExe) { try { $args = "-runfromtemp -l0x0407 -removeonly /s" Write-Host " -> $coExe $args" Start-Process $coExe -ArgumentList $args -Wait -ErrorAction Stop Write-Host " -> HP Connection Optimizer uninstalled." } catch { Write-Warning " -> Error uninstalling HP Connection Optimizer: $($_.Exception.Message)" } } else { Write-Host " HP Connection Optimizer setup.exe not found – maybe already removed." } # -------------------------------------------------------------------- # 6) HP Documentation – exact CMD uninstall # -------------------------------------------------------------------- Write-Host "HP Documentation…" $docCmd = "C:\Program Files\HP\Documentation\Doc_Uninstall.cmd" if (Test-Path $docCmd) { try { Start-Process "cmd.exe" -ArgumentList "/c `"$docCmd`"" -Wait -ErrorAction Stop Write-Host " -> HP Documentation uninstalled." } catch { Write-Warning " -> Error uninstalling HP Documentation: $($_.Exception.Message)" } } else { Write-Host " HP Documentation not found – maybe already removed." } # -------------------------------------------------------------------- # 7) HP Insights – proper MSI uninstall (instead of /I) # -------------------------------------------------------------------- Write-Host "HP Insights (MSI)…" $insightsGuid = "{B1C44EC2-0AB5-4777-9EAF-532196758090}" try { Start-Process "msiexec.exe" -ArgumentList "/X$insightsGuid /qn /norestart" -Wait -ErrorAction Stop Write-Host " -> HP Insights uninstalled." } catch { Write-Warning " -> Error uninstalling HP Insights: $($_.Exception.Message)" } # additionally try to catch other Insights / Touchpoint variants Invoke-RegistryUninstall -Patterns @( "*HP Insights*", "*HP Touchpoint Analytics*" ) # -------------------------------------------------------------------- # 8) Remove HP Insights / Analytics / auto-installer services # (Support Assistant & all *HSA Service* are kept!) # -------------------------------------------------------------------- Write-Host "Cleaning up HP Insights-related services…" # 8.1 Exact, safe service names: $hpInsightsServiceNames = @( "HP Services Scan", "HP Insights Agent", "HP Insights WatchDog Service", "HP Audio Analytics Service" ) foreach ($svcName in $hpInsightsServiceNames) { $svc = Get-Service -Name $svcName -ErrorAction SilentlyContinue if ($null -ne $svc) { Write-Host " Exact: stopping and deleting $($svc.DisplayName)" try { if ($svc.Status -ne "Stopped") { Stop-Service -Name $svc.Name -Force -ErrorAction SilentlyContinue } sc.exe delete "$($svc.Name)" | Out-Null } catch { Write-Warning " Error removing service $($svc.DisplayName): $($_.Exception.Message)" } } } # 8.2 Pattern-based cleanup (without touching HSA / hotkey / switching services) $hpSvcPatterns = @( "*Insights*", "*Touchpoint*", "*Audio Analytics*" ) $protectedPatterns = @( "*HSA Service*", # keep all HSA services "*Support Assistant*", # in case of a dedicated service "*Hotkey UWP Service*", "*LAN/WLAN/WWAN Switching UWP Service*" ) foreach ($svc in Get-Service -ErrorAction SilentlyContinue) { $name = $svc.DisplayName if (-not $name) { continue } # protection: services that must never be removed $isProtected = $false foreach ($pp in $protectedPatterns) { if ($name -like $pp) { $isProtected = $true break } } if ($isProtected) { continue } foreach ($pat in $hpSvcPatterns) { if ($name -like $pat) { Write-Host " Pattern: stopping and deleting $name" try { if ($svc.Status -ne "Stopped") { Stop-Service -Name $svc.Name -Force -ErrorAction SilentlyContinue } sc.exe delete "$($svc.Name)" | Out-Null } catch { Write-Warning " Error removing service $($name): $($_.Exception.Message)" } break } } } # -------------------------------------------------------------------- # 9) Clean up HP scheduled tasks # - remove unwanted HP tasks # - remove empty HP task folders # -------------------------------------------------------------------- Write-Host "Cleaning up HP scheduled tasks…" # Which task names should be removed? $hpTaskNamePatternsToRemove = @( "*HP Insights*", "*Touchpoint*", "*Analytics*", "Consent Manager Launcher" ) # Which task paths should be cleaned up? $hpTaskPathPatternsToRemove = @( "\HP\*", "\Hewlett-Packard\HP Wolf Security\*" ) # Which tasks/folders must be kept? $hpTaskProtectedPatterns = @( "*Support Assistant*" ) # 9.1 Remove tasks $allTasks = Get-ScheduledTask -ErrorAction SilentlyContinue foreach ($task in $allTasks) { $remove = $false # match by task name foreach ($p in $hpTaskNamePatternsToRemove) { if ($task.TaskName -like $p) { $remove = $true break } } # match by task path (if not already decided) if (-not $remove) { foreach ($p in $hpTaskPathPatternsToRemove) { if ($task.TaskPath -like $p) { $remove = $true break } } } if (-not $remove) { continue } # protection: keep any Support Assistant tasks $protected = $false foreach ($p in $hpTaskProtectedPatterns) { if ($task.TaskName -like $p -or $task.TaskPath -like "*Support Assistant*") { $protected = $true break } } if ($protected) { continue } Write-Host " Removing HP task: $($task.TaskPath)$($task.TaskName)" try { Unregister-ScheduledTask -TaskName $task.TaskName -TaskPath $task.TaskPath -Confirm:$false } catch { Write-Warning " Error removing task $($task.TaskPath)$($task.TaskName): $($_.Exception.Message)" } } # 9.2 Recursively remove empty HP task folders Write-Host "Cleaning up empty HP task folders…" function Remove-EmptyTaskFolderRecursive { param( [Parameter(Mandatory)][string]$FolderPath, [Parameter(Mandatory)]$Service ) try { $folder = $Service.GetFolder($FolderPath) } catch { # folder does not exist -> nothing to do return } # first process subfolders (bottom-up) foreach ($sub in @($folder.GetFolders(0))) { Remove-EmptyTaskFolderRecursive -FolderPath $sub.Path -Service $Service } # now check if this folder is empty $hasTasks = ($folder.GetTasks(1).Count -gt 0) $hasFolders = ($folder.GetFolders(1).Count -gt 0) if (-not $hasTasks -and -not $hasFolders -and $FolderPath -ne "\") { $parentPath = Split-Path $FolderPath if ([string]::IsNullOrWhiteSpace($parentPath)) { $parentPath = "\" } $name = Split-Path $FolderPath -Leaf Write-Host " Removing empty folder: $FolderPath" try { $parent = $Service.GetFolder($parentPath) $parent.DeleteFolder($name, 0) } catch { Write-Warning " Error deleting folder $($FolderPath): $($_.Exception.Message)" } } } try { $service = New-Object -ComObject "Schedule.Service" $service.Connect() # roots we want to clean up foreach ($rootPath in @("\HP", "\Hewlett-Packard\HP Wolf Security")) { Remove-EmptyTaskFolderRecursive -FolderPath $rootPath -Service $service } } catch { Write-Warning " Error accessing Task Scheduler (COM): $($_.Exception.Message)" } # -------------------------------------------------------------------- # 10) Remove leftover uninstall registry entries for # HP Connection Optimizer & HP Documentation # -------------------------------------------------------------------- Write-Host "Cleaning uninstall registry entries for HP Connection Optimizer / HP Documentation…" $hpCleanupPatterns = @( "*HP Connection Optimizer*", "*HP Documentation*" ) $uninstallRoots = @( "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ) foreach ($root in $uninstallRoots) { Get-ChildItem -Path $root -ErrorAction SilentlyContinue | ForEach-Object { try { $props = Get-ItemProperty -Path $_.PSPath -ErrorAction SilentlyContinue } catch { continue } if (-not $props.DisplayName) { continue } foreach ($pattern in $hpCleanupPatterns) { if ($props.DisplayName -like $pattern) { Write-Host " Deleting uninstall key: '$($props.DisplayName)'" Write-Host " Path: $($_.PSPath)" try { Remove-Item -Path $_.PSPath -Recurse -Force -ErrorAction Stop } catch { Write-Warning " Error deleting uninstall key: $($_.Exception.Message)" } } } } } # -------------------------------------------------------------------- # 11) Remove start menu shortcuts (HP Documentation / Miro Offer / TCO Certified) # -------------------------------------------------------------------- Write-Host "Cleaning start menu shortcuts…" $shortcutNames = @( "HP Documentation", "Miro Offer", "TCO Certified" ) $programsPath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" foreach ($name in $shortcutNames) { # find .lnk files with matching base name $lnks = Get-ChildItem -Path $programsPath -Recurse -ErrorAction SilentlyContinue ` | Where-Object { -not $_.PSIsContainer -and $_.Extension -eq ".lnk" -and $_.BaseName -like "$name*" } foreach ($lnk in $lnks) { Write-Host " Removing shortcut: $($lnk.FullName)" try { Remove-Item -Path $lnk.FullName -Force -ErrorAction Stop } catch { Write-Warning " Error deleting $($lnk.FullName): $($_.Exception.Message)" } } # remove matching start menu folders if present $dirs = Get-ChildItem -Path $programsPath -Recurse -Directory -ErrorAction SilentlyContinue ` | Where-Object { $_.Name -like "$name*" } foreach ($dir in $dirs) { Write-Host " Removing start menu folder: $($dir.FullName)" try { Remove-Item -Path $dir.FullName -Recurse -Force -ErrorAction Stop } catch { Write-Warning " Error deleting folder $($dir.FullName): $($_.Exception.Message)" } } } # -------------------------------------------------------------------- # 12) Tag file for Intune detection rule # -------------------------------------------------------------------- Write-Host "Creating Intune tag file…" $tagFolder = "$env:ProgramData\Microsoft\RemoveHPBloatware" $tagFile = Join-Path $tagFolder "hpbloatware_uninstall.ps1.tag" if (-not (Test-Path $tagFolder)) { New-Item -ItemType Directory -Path $tagFolder -Force | Out-Null } Set-Content -Path $tagFile -Value "Installed" -Force Write-Host "Tag file: $tagFile" Write-Host "===== HP cleanup finished =====" Exit 0
Thanks a lot! 🙏









Will update this to my environment and report back.