Uninstall Windows App from Powershell

From UVOO Tech Wiki
Revision as of 01:54, 23 May 2021 by Busk (talk | contribs) (Created page with "# Uninstall App Using UninstallString ``` $search = 'myapp' $64bitnode = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall' $32bitnode = 'HKLM:\SOFTWARE\Wow6432Node\M...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Uninstall App Using UninstallString

$search = 'myapp'
$64bitnode = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
$32bitnode = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
$Uninstaller = Get-ChildItem -Path $64bitnode,$32bitnode  | Get-ItemProperty | Where-Object {$_.DisplayName -match $search }
$Uninstaller | Select-Object -Property DisplayName, UninstallString
$Uninstaller | ForEach { Start-Process -FilePath MsiExec.exe -ArgumentList "/X$($PSItem.PSChildName) /Q" -Wait }

https://www.reddit.com/r/PowerShell/comments/7mn0u7/help_with_registry_query_for_uninstall_string/