Skip to content

Instantly share code, notes, and snippets.

@shanecowherd
Last active May 14, 2021 15:43
Show Gist options
  • Save shanecowherd/2abc8416656ecfd0bd95b1199326d243 to your computer and use it in GitHub Desktop.
Save shanecowherd/2abc8416656ecfd0bd95b1199326d243 to your computer and use it in GitHub Desktop.
The default browser on Windows Server is locked down, this Powershell script allows you to download Chrome.
#https://www.snel.com/support/install-chrome-in-windows-server/
$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