Created
March 19, 2023 15:37
-
-
Save devenes/47a4c36f9fb91bfd0e9ba74b2cdbfb6c to your computer and use it in GitHub Desktop.
Install Google Chrome on Windows Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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");Start-Process -FilePath "$LocalTempDir\$ChromeInstaller" -ArgumentList '/silent', '/install' -Wait;$Process2Monitor="chrome";Do{$ProcessesFound=Get-Process -Name $Process2Monitor -ErrorAction SilentlyContinue;if($ProcessesFound){Write-Host "Still running: $($ProcessesFound.Name -join ', ')";Start-Sleep -Seconds 2}else{Remove-Item -Path "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose}}until(!$ProcessesFound)$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");Start-Process -FilePath "$LocalTempDir\$ChromeInstaller" -ArgumentList '/silent', '/install' -Wait;$Process2Monitor="chrome";Do{$ProcessesFound=Get-Process -Name $Process2Monitor -ErrorAction SilentlyContinue;if($ProcessesFound){Write-Host "Still running: $($ProcessesFound.Name -join ', ')";Start-Sleep -Seconds 2}else{Remove-Item -Path "$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