Created
October 9, 2023 17:46
-
-
Save deekayen/708ba3f8bff965d8099291dcb7f42401 to your computer and use it in GitHub Desktop.
Get list of all the GUIDs for uninstalling microsoft applications on Windows.
This file contains 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
# https://4sysops.com/archives/find-the-product-guid-of-installed-software-with-powershell/ | |
$UninstallKeys = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | |
$null = New-PSDrive -Name HKU -PSProvider Registry -Root Registry::HKEY_USERS | |
$UninstallKeys += Get-ChildItem HKU: -ErrorAction SilentlyContinue | Where-Object { $_.Name -match 'S-\d-\d+-(\d+-){1,14}\d+$' } | ForEach-Object { "HKU:\$($_.PSChildName)\Software\Microsoft\Windows\CurrentVersion\Uninstall" } | |
foreach ($UninstallKey in $UninstallKeys) { | |
Get-ChildItem -Path $UninstallKey -ErrorAction SilentlyContinue | Where {$_.PSChildName -match '^{[A-Z0-9]{8}-([A-Z0-9]{4}-){3}[A-Z0-9]{12}}$'} | Select-Object @{n='GUID';e={$_.PSChildName}}, @{n='Name'; e={$_.GetValue('DisplayName')}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment