From adeef97796d34509fe2e51e4abd15be05a36a2a7 Mon Sep 17 00:00:00 2001 From: Daniel Dybing Date: Mon, 22 Dec 2025 17:28:45 +0100 Subject: [PATCH] feat: add GetGUIDApp.ps1 utility to help find software GUIDs --- utils/GetGUIDApp.ps1 | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 utils/GetGUIDApp.ps1 diff --git a/utils/GetGUIDApp.ps1 b/utils/GetGUIDApp.ps1 new file mode 100644 index 0000000..1c677a4 --- /dev/null +++ b/utils/GetGUIDApp.ps1 @@ -0,0 +1,56 @@ +<# +.SYNOPSIS + Lists installed software and their GUIDs/Registry Keys. + +.DESCRIPTION + This script scans the Windows Registry (HKLM and WOW6432Node) for installed applications + and outputs their Display Name and Registry Key Name (which is often the MSI GUID). + + Useful for finding the GUID of software to target for uninstallation. + +.PARAMETER Filter + Optional string to filter the results by Display Name. + +.EXAMPLE + .\GetGUIDApp.ps1 + Lists all installed software in a grid view. + +.EXAMPLE + .\GetGUIDApp.ps1 -Filter "Printer" + Lists only software with "Printer" in the name. +#> + +param ( + [string]$Filter = "" +) + +$paths = @( + "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", + "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" +) + +Write-Host "Scanning Registry for Installed Software..." -ForegroundColor Cyan + +$results = @() + +foreach ($path in $paths) { + $items = Get-ItemProperty $path -ErrorAction SilentlyContinue + foreach ($item in $items) { + if (-not [string]::IsNullOrWhiteSpace($item.DisplayName)) { + $results += [PSCustomObject]@{ + DisplayName = $item.DisplayName + RegistryKeyName = $item.PSChildName # This is the GUID for MSI apps + UninstallString = $item.UninstallString + } + } + } +} + +if (-not [string]::IsNullOrWhiteSpace($Filter)) { + Write-Host "Filtering for: '$Filter'" -ForegroundColor Yellow + $results = $results | Where-Object { $_.DisplayName -match "(?i)$Filter" } +} + +$results | Sort-Object DisplayName | Out-GridView -Title "Installed Software (Select to see details)" + +Write-Host "Done. Check the Grid View window." -ForegroundColor Green \ No newline at end of file