0

I need to find the uninstall ID of a particular application and if it exists uninstall.

$MSIID = "{9F21231E-4073-4749-B331-D3206168B509}"
$FileExists = Test-Path $MSIID Test-
If ($FileExists -eq $True) {
msiexec.exe /x "{9F21231E-4073-4749-B331-D3206168B509}" /qr
}
DHeinz
  • 11
  • 2
  • Possible duplicate of [How can I uninstall an application using PowerShell?](https://stackoverflow.com/questions/113542/how-can-i-uninstall-an-application-using-powershell) – Ken White May 17 '19 at 20:10

2 Answers2

0

The msi uninstall information can be found in the registry at the key below:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Perhaps you could find the key by display name and pull the needed info.

Another route to persue would be to query one of the Msi api functions.

Ross Bush
  • 14,648
  • 2
  • 32
  • 55
0
get-package *pattern* | uninstall-package
js2010
  • 23,033
  • 6
  • 64
  • 66