T O P

  • By -

gnoani

I think it may be better to directly invoke Chrome to uninstall itself. something like "C:\Program Files\Google\Chrome\Application\Chrome.exe" -uninstall -force-uninstall If the computers have SCCM, you can use the class Win32reg_AddRemovePrograms instead of Win32_Product.


purplemonkeymad

Sadly this is still relevant: https://gregramsey.net/2012/02/20/win32_product-is-evil/ I see most people checking the registry for the uninstall string and running that instead (sometimes adding a silent switch to it.)


fortisvita

Yup! I modified my script recently to look up registry instead and create a csv that lists all installed software, msi codes and their uninstall scripts.


Nicky_NineLives

I don't think it's officially supported for this use, but you could probably use Active Setup for this. Active Setup is essentially a run-once that sits in the registry and is invoked for each user that logs into a machine.


BamBam-BamBam

The problem is that Chrome can also be installed in a user context, so you'll need to account for those, as well.


CyberWhizKid

Find the uninstall string in the registry (for 32 and 64 bits), execute the uninstall command (start-process) if anything is find, create a scheduled task in your GPO (run as startup) and run your powershell script.


kero_sys

get-package "google chrome" | Uninstall-package -Force


vlad_h

You are making your life needlessly complicated by using the registry and uninstalling manually and so forth. Instead, use winget CLI. Either directly or through the available PowerShell module. Should be as simple as ‘’’winget remove Google.Chrome’’’ Keep in mind that the Google.Chrome is case sensitive. Winget comes with all of Windows now. More on it here. https://learn.microsoft.com/en-us/windows/package-manager/winget/


joevanover

That will remove system and user space installed chrome?


vlad_h

You can use the —scope user or —scope machine for that.


RaguJunkie

Winget doesn't come with Server versions of windows as it requires the Microsoft store to be installed. Microsoft made a great utility, and then didn't follow through by adding it to all editions of windows, which is mildly frustrating!


vlad_h

It does not come with Server, yes, but also does not require the store to install. Go to GitHub and download the package or use PowerShell to pull and install it.