Uninstall Windows App from Powershell

From UVOO Tech Wiki
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/