Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install latest chrome using powershell

I am trying below tutorial to install it.

https://www.thewindowsclub.com/install-google-chrome-using-windows-powershell#:~:text=Install%20Google%20Chrome%20using%20PowerShell&text=Click%20on%20the%20Start%20button,button%20to%20give%20your%20consent.&text=Press%20the%20Enter%20key%20and%20wait%20till%20it%20finishes.

and command is

$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)

But this is giving me Chrome version 89.xx not latest. I need both chromdriver and Chrome Browser match the same.

Command I am using to install chrome binary choco install chromedriver this gives me ChromeDriver version 90

like image 204
paul Avatar asked Sep 20 '25 09:09

paul


1 Answers

You can use the below script to install the latest chrome on windows

$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path$Installer; Start-Process -FilePath $Path$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path$Installer
like image 164
Bharat Gadade Avatar answered Sep 22 '25 05:09

Bharat Gadade