PowerShell: Remove Google Chrome (any version)

The following PowerShell script will allow you to remove any installed version of Google Chrome.

Function UninstallChrome() {
    $app = get-wmiobject Win32_Product | Where-Object {$_.Name -eq "Google Chrome"}
    $removeChrome = $app.IdentifyingNumber msiexec /x
    $removeChrome /q
 }
 
# If chrome is running then close the process and uninstall it
 If (Get-Process chrome -ErrorAction SilentlyContinue) {
    # Chrome is running
    # Stop chrome process
    Stop-Process -Name chrome -Force

    # Now uninstall chrome
    UninstallChrome
 } Else {
     # Chrome is not running…
     # Uninstall chrome
     UninstallChrome
 } 

, , , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: