How to Install Google Chrome With PowerShell
By Timothy Tibbetts |
Here's a fun trick for PowerShell geeks. By using a line of code we provide, you can install Google Chrome in minutes.
You might be wondering why, and our first response would be, "Why not?" But, if you have this code handy, many technicians who plan to install Google Chrome will appreciate saving the extra step of going to Google, downloading, and running the installer.
Video tutorial:
Open PowerShell as Administrator and copy and paste:
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('https://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)
You will see Still running: ChromeInstaller numerous times.
When the code stops running, you should see the Google Chrome shortcut on your Desktop with the latest version installed.

Enjoy.
This code is included as part of MajorGeeks Windows Tweaks.
Similar:
The Ultimate List of Every Known Command Prompt and PowerShell Commands
How to Customize Fonts, Colors, Window Size and More With Powershell or Command Prompt
How to View, Save, and Clear Your PowerShell and Command Prompt History
How to Add 'Open PowerShell Window Here' as Administrator Context Menu
How to Disable the Command Prompt in Windows 10
comments powered by Disqus
You might be wondering why, and our first response would be, "Why not?" But, if you have this code handy, many technicians who plan to install Google Chrome will appreciate saving the extra step of going to Google, downloading, and running the installer.
Open PowerShell as Administrator and copy and paste:
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('https://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)
You will see Still running: ChromeInstaller numerous times.
When the code stops running, you should see the Google Chrome shortcut on your Desktop with the latest version installed.

Enjoy.
This code is included as part of MajorGeeks Windows Tweaks.
Similar:
The Ultimate List of Every Known Command Prompt and PowerShell Commands
How to Customize Fonts, Colors, Window Size and More With Powershell or Command Prompt
How to View, Save, and Clear Your PowerShell and Command Prompt History
How to Add 'Open PowerShell Window Here' as Administrator Context Menu
How to Disable the Command Prompt in Windows 10
comments powered by Disqus