Skip to content

Instantly share code, notes, and snippets.

@paxmanchris
Created December 12, 2021 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paxmanchris/7d992d09a75bdccc5eebb786ec848d18 to your computer and use it in GitHub Desktop.
Save paxmanchris/7d992d09a75bdccc5eebb786ec848d18 to your computer and use it in GitHub Desktop.
Get uninstall strings from windows registry
# some apps will not show up in the wmi win32_product object, but there is a way to get the uninstall string for everything
# this will troll the registry and show those apps. Note that the uninstall strings listed will likly not be silent or unattended
# so you may need to do your own research on how to do that
function get-uninstall-list {
param (
$Installed
)
$sanity = new-object System.Collections.ArrayList
foreach ($app in $Installed) {
$props = @{}
foreach($item in $app.Property){
$props[$item] = $app.GetValue($item)
}
$sanity.Add([PSCustomObject]$props)|Out-Null
}
return $sanity
}
$win32_installed = Get-ChildItem hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
$wow64_installed = Get-ChildItem hklm:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
$win32apps = get-uninstall-list $win32_installed
$wow64apps = get-uninstall-list $wow64_installed
Write-Host "== win32apps =="
$win32apps | select displayname, uninstallstring
Write-Host "== wow64apps =="
$wow64apps | select displayname, uninstallstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment