Created
July 7, 2025 18:54
-
-
Save CarissaDurko/fac4f074a41ce179856b0531e34b418a to your computer and use it in GitHub Desktop.
Tenable Detection PowerShell Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $msiProductCodes = @( | |
| '{GUID}' | |
| ) | |
| $paths = @( | |
| "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", | |
| "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | |
| ) | |
| foreach ($path in $paths) { | |
| foreach ($guid in $msiProductCodes) { | |
| $fullKey = Join-Path $path $guid | |
| if (Test-Path $fullKey) { | |
| $uninstallString = (Get-ItemProperty -Path $fullKey).UninstallString | |
| if ($uninstallString) { | |
| if ($uninstallString -like "msiexec*") { | |
| $uninstallString += " /qn /norestart" | |
| } | |
| $exe, $args = $uninstallString -split ' ', 2 | |
| $exe = $exe.Trim('"') | |
| Start-Process -FilePath $exe -ArgumentList $args -NoNewWindow -WindowStyle Hidden -Wait | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment