Skip to content

Instantly share code, notes, and snippets.

@jbnunn
Forked from kurokikaze/gist:350fe1713591641b3b42
Last active April 6, 2021 16:38
Show Gist options
  • Save jbnunn/0b25289a970c7df5b50cd0ac861d07c5 to your computer and use it in GitHub Desktop.
Save jbnunn/0b25289a970c7df5b50cd0ac861d07c5 to your computer and use it in GitHub Desktop.
Install Google Chrome from Powershell
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)
@Roy-Hill
Copy link

what do you think of this version (not my own but I can't find where I got it from..and I've modified it)
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B297129A1-A25F-2799-7699-95238E0A3F50%7D%26lang%3Den%26browser%3D3%26usagestats%3D1%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26installdataindex%3Dempty/update2/installers/ChromeSetup.exe" -OutFile $Path$Installer; Start-Process -FilePath $Path$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path$Installer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment