Chrome installation on EC2 Windows via Powershell.

Awais Bajwa
2 min readAug 10, 2021

--

Security prevents installing Chrome, here is the magical power-shell command

A quick tip, that saved my time.

I normally use Linux on EC2, today I had to install a Windows EC2 the first time, as I was required to review my Machine Learning pipeline design & the related datasets (GDPR requirement).

I this quick blog I will share a quick way to install Chrome via Power-shell.

Initially, when I tried to install Chrome, I got multiple security errors

I used the following command in Powershell and it magically installed the chrome and created a short-cut.

$Installer = “chrome_installer.exe”
Invoke-WebRequest “
http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer
Start-Process -FilePath $Path\$Installer -Args “/silent /install” -Verb RunAs -Wait
Remove-Item $Path\$Installer
$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)

The chrome shortcut appeared on my desktop.

Thank you for reading.

--

--

Awais Bajwa
Awais Bajwa

Written by Awais Bajwa

Enterprenurer, AI/ML/DL engineer, Public speaker, Artificial Intelligence Enthusiast (GE, Emerson, E&Y, IBM) All views are my own. Founder & CEO of Ophthalytics

No responses yet