Skip to content

Instantly share code, notes, and snippets.

View huseyinozyilmaz's full-sized avatar

Huseyin M Ozyilmaz huseyinozyilmaz

View GitHub Profile
@huseyinozyilmaz
huseyinozyilmaz / install-chrome.ps1
Created April 10, 2018 10:00
Install Google Chrome with Powershell
$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) { "Installing..." | Write-Host; Start-Sleep -Seconds 2 } else { Remove-Item "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue } } Until (!$ProcessesFound)