Skip to content

Instantly share code, notes, and snippets.

@craysiii
Created May 2, 2020 00:25
Show Gist options
  • Save craysiii/50042edceb2ff77288558eb6b930dab9 to your computer and use it in GitHub Desktop.
Save craysiii/50042edceb2ff77288558eb6b930dab9 to your computer and use it in GitHub Desktop.
Uninstall Chrome with Powershell Silently
$64bit = if ([System.IntPtr]::Size -eq 8) { $true } else { $false }
$RegKeys = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\')
if ($true -eq $64bit) { $RegKeys += 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\'}
$Apps = $RegKeys | Get-ChildItem | Get-ItemProperty | Where-Object { $_.DisplayName -like '*Chrome*' }
$Apps | ForEach-Object {
$ExecLocation = "$($_.UninstallString.Split('"')[1])"
Start-Process -FilePath "$ExecLocation" -ArgumentList "--uninstall --system-level --force-uninstall" -Wait
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment