Skip to content

Instantly share code, notes, and snippets.

@saurabhj
Created January 14, 2017 06:33
Show Gist options
  • Save saurabhj/5193ba089f6c6729f1883b082a1c6a26 to your computer and use it in GitHub Desktop.
Save saurabhj/5193ba089f6c6729f1883b082a1c6a26 to your computer and use it in GitHub Desktop.
Download Chrome via Powershell
#Copy via: https://gist.github.com/kurokikaze/350fe1713591641b3b42#gistcomment-1754878
$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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment