Add install-wsl.ps1

This commit is contained in:
Markus Fleschutz
2021-08-02 20:45:34 +02:00
parent 1cee5b6ae2
commit 829e04afe1
5 changed files with 46 additions and 1 deletions

View File

@ -12,12 +12,16 @@
#>
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
$Path = $env:TEMP;
$Installer = "chrome_installer.exe"
Invoke-WebRequest "http://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
write-host -foregroundColor green "✔️ installed Google Chrome"
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ installed Google Chrome in $Elapsed sec"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"