- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
- HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall
Created
January 26, 2023 14:30
-
-
Save rodrigoborgesdeoliveira/38b90087fd55a04fd97aeef6a2a1aea5 to your computer and use it in GitHub Desktop.
Possible registry locations to find an installed program and get the product code from
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
function Search-RegistryUninstallKey { | |
param($SearchFor,[switch]$Wow6432Node) | |
$results = @() | |
$keys = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | | |
foreach { | |
$obj = New-Object psobject | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name GUID -Value $_.pschildname | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name DisplayName -Value $_.GetValue("DisplayName") | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name DisplayVersion -Value $_.GetValue("DisplayVersion") | |
if ($Wow6432Node) | |
{Add-Member -InputObject $obj -MemberType NoteProperty -Name Wow6432Node? -Value "No"} | |
$results += $obj | |
} | |
if ($Wow6432Node) { | |
$keys = Get-ChildItem HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | | |
foreach { | |
$obj = New-Object psobject | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name GUID -Value $_.pschildname | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name DisplayName -Value $_.GetValue("DisplayName") | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name DisplayVersion -Value $_.GetValue("DisplayVersion") | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name Wow6432Node? -Value "Yes" | |
$results += $obj | |
} | |
} | |
$results | sort DisplayName | where {$_.DisplayName -match $SearchFor} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: https://smsagent.blog/2015/10/15/searching-the-registry-uninstall-key-with-powershell/
Usage: Paste
Search-RegistryUninstallKey
in powershell and run