Uninstall Chrome silently using Powershell

Andrew picture Andrew · Feb 14, 2020 · Viewed 10.2k times · Source

I have the following PowerShell script, which I am using to get the uninstall string for Google Chrome, and then I want to uninstall it silently. Line 3 in the script will pop up the GUI uninstaller (so it seems like everything is correct thus far), but if I add "/qn" or "/quiet" to the argument list, the uninstall doesn't seem to run at all, even if I let it sit for a couple hours.

What am I missing?

    $AppName = "Google Chrome"
    $Chrome = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -match $($AppName)}
    Start-Process -Wait -FilePath MsiExec.exe -Argumentlist "/X",$Chrome.UninstallString.TrimStart("MsiExec.exe /X")

Answer

js2010 picture js2010 · Feb 14, 2020

If it's an msi you can use uninstall-package:

get-package *chrome* | uninstall-package -whatif