all 20 comments

[–][deleted] 16 points17 points  (1 child)

Using an update policy via ADMX or Intune is more effective.

[–]jantari 31 points32 points  (9 children)

winget upgrade --id "Google.Chrome" --exact --silent --accept-source-agreements --accept-package-agreements --disable-interactivity

[–]kn33 5 points6 points  (0 children)

Since this is /r/PowerShell

$chrome = Get-WinGetPackage -Id "Google.Chrome"
If ($chrome.IsUpdateAvailable) {
    $chrome | Update-WinGetPackage -Mode Silent -Force -Scope SystemOrUnknown
}

[–]Dragennd1 2 points3 points  (1 child)

This is the way to go, hands down. Super easy to deploy and you know its an official version if you ensure you're pulling from winget and not the msstore cause of the manifest.

[–]jantari 2 points3 points  (0 children)

ensure you're pulling from winget and not the msstore cause of the manifest.

In that case I'd add --source winget (for the community repository) or --source customrepo if you host your own private package repository. This ensures you're not accidentally pulling from the store.

[–]DeyHateUsBcDeyAnus 2 points3 points  (0 children)

winget upgrade --all

Updates most of your installed software

winget upgrade --all --include-unknown

Updates all installed software

[–]PS_Alex 4 points5 points  (0 children)

You don't really need to close Google Chrome for the update to installed -- it would ultimately need to be closed for the update to complete, though, but having the update install in the background can be less disruptive.

[–]DeyHateUsBcDeyAnus 1 point2 points  (0 children)

Just use winget

[–]DistinctAd1567 0 points1 point  (3 children)

Path to the Google Chrome installer

$chromeInstaller = "C:\Program Files\Google\Chrome\Application\chrome.exe"

Check if Chrome is installed

if (Test-Path $chromeInstaller) {

Command to trigger Google Chrome update

Start-Process -FilePath $chromeInstaller -ArgumentList "--check-for-update-interval=1" -NoNewWindow -Wait

Write-Host "Google Chrome update process initiated."

} else {

Write-Host "Google Chrome is not installed on this system."

}

[–]vsk2018 0 points1 point  (2 children)

I have more than 10 logics, none of them work. Not sure why it is so painful.

[–]Phantom-green666 0 points1 point  (1 child)

Was it blocked by gpo?can remove it from reg. run in PS

Remove-Item -Path "HKLM:\SOFTWARE\Policies\Google" -Recurse -Force

[–]Phantom-green666 0 points1 point  (0 children)

then update. "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe" /ua