Category filter
Script to uninstall any version of Chrome on Windows
Admins might want to uninstall Google Chrome from their devices for various reasons. For instance, you would want to remove the existing browser, or specifically, Chrome browser, after switching to another browser to ensure the users widely use the newly chosen browser or to free up space. Alternatively, you might need to uninstall a specific version of Chrome because it’s reported to have issues across the devices. In any case, trying to uninstall Chrome manually from each device is hectic and cumbersome. With the Execute Custom Script action, you can execute custom scripts to uninstall a specific version or all versions of Google Chrome present across your Windows device.
PowerShell script to uninstall a specific version of Chrome
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$version = "<Enter app version>" $chrome = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like "*Google Chrome*"} | Where-Object {$_.Version -eq $version} if ($chrome) { $chrome.Uninstall() Write-Output "Google Chrome successfully uninstalled" } else { Write-Host "Chrome version $version not found" } |
Replace Enter the app version
with the corresponding version of Chrome that you want to uninstall. For example, if you want to uninstall the Chrome app version 111.0.5563.65:
$version = "111.0.5563.65"
$chrome = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like "*Google Chrome*"} | Where-Object {$_.Version -eq $version}
if ($chrome) {
$chrome.Uninstall()
Write-Output "Google Chrome successfully uninstalled"
} else {
Write-Host "Chrome version $version not found"
}
If the specified Chrome version is not found on the device, the following message will be displayed, “Chrome *specified version* not found” and the Chrome app present on the device won’t be removed.
PowerShell script to uninstall Chrome irrespective of its app version
This script uses the Windows Management Instrumentation (WMI) to uninstall Google Chrome from a windows device irrespective of its version.
1 2 3 4 5 6 7 8 9 |
$Chrome = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "Google Chrome*" } foreach ($Product in $Chrome) { $Product.Uninstall() } Write-Output "Google Chrome successfully uninstalled" |