Created
March 22, 2020 12:03
-
-
Save stanionascu/d505fc4762a4ab070bbf0a481be488ec to your computer and use it in GitHub Desktop.
Install MS Edge via PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$LocalTempDir = $env:TEMP; | |
$EdgeInstaller = "MSEdgeInstaller.exe"; | |
(new-object System.Net.WebClient).DownloadFile('https://c2rsetup.officeapps.live.com/c2r/downloadEdge.aspx?ProductreleaseID=Edge&platform=Default&version=Edge&source=EdgeStablePage&Channel=Stable&language=en', "$LocalTempDir\$EdgeInstaller"); | |
& "$LocalTempDir\$EdgeInstaller" /silent /install; | |
$Process2Monitor = "MSEdgeInstaller"; | |
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\$EdgeInstaller" -ErrorAction SilentlyContinue -Verbose | |
} | |
} Until (!$ProcessesFound) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment