Skip to content

Instantly share code, notes, and snippets.

Forked from kurokikaze/gist:350fe1713591641b3b42
Last active April 6, 2021 16:38
  • Star 16 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
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('', "$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)
Copy link

ltiwana commented Jun 3, 2018

Very nice.

Copy link

Thank you jbnunn

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 "" -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