Table of Contents
Installing the Google Chrome using PowerShell
Would you like to learn how to install Google Chrome using Powershell? In this tutorial, we are going to show you how to use Powershell to install Google Chrome on a computer running Windows.
- Create a temporary directory to store Google Chrome.
- Download the Google Chrome installer.
- Perform a silent installation of Google Chrome.
Full script to download and install Google Chrome using a PowerShell.
#Create a temporary directory to store Google Chrome.
md -Path $env:temp\chromeinstall -erroraction SilentlyContinue | Out-Null
$Download = join-path $env:temp\chromeinstall chrome_installer.exe
#Download the Google Chrome installer.
$url = 'https://dl.google.com/chrome/install/latest/chrome_installer.exe'
Invoke-WebRequest $url -OutFile $Download
#Perform a silent installation of Google Chrome.
Invoke-Expression "$Download /silent /install"
Verify the installation of Google Chrome.
$INSTALLED = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
$INSTALLED += Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
$INSTALLED | ?{ $_.DisplayName -match 'chrome' } | sort-object -Property DisplayName -Unique | Format-Table -AutoSize
Here is the command output. Congratulations! You are able to install Google Chrome using PowerShell.
DisplayName DisplayVersion Publisher InstallDate
----------- -------------- --------- -----------
Google Chrome 104.0.5112.81 Google LLC 20220809
If your Windows running an older PowerShell versions, let’s using the following script to download and install the latest version of Google Chrome.
#Create a temporary directory to store Google Chrome.
md -Path $env:temp\chromeinstall -erroraction SilentlyContinue | Out-Null
$Download = join-path $env:temp\chromeinstall chrome_installer.exe
#Download the Google Chrome installer.
$url = 'https://dl.google.com/chrome/install/latest/chrome_installer.exe'
(new-object System.Net.WebClient).DownloadFile($url,$Download)
#Perform a silent installation of Google Chrome.
Invoke-Expression "$Download /silent /install"
5/5 - (3 votes)