Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created July 8, 2019 21:35
Show Gist options
  • Save PrateekKumarSingh/aad3eb736fca7198d8fbe59fd6ccdb22 to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/aad3eb736fca7198d8fbe59fd6ccdb22 to your computer and use it in GitHub Desktop.
$URLs = "https://aka.ms/wsl-ubuntu-1804" ,"https://aka.ms/wsl-ubuntu-1804-arm" ,"https://aka.ms/wsl-ubuntu-1604" ,"https://aka.ms/wsl-debian-gnulinux" ,"https://aka.ms/wsl-kali-linux" ,"https://aka.ms/wsl-opensuse-42" ,"https://aka.ms/wsl-sles-12"
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'
Foreach($URL in $URLs){
$Filename = "$(Split-Path $URL -Leaf).appx"
Write-Host "Downloading: $Filename" -Foreground Yellow -NoNewline
try{
Invoke-WebRequest -Uri $URL -OutFile $Filename -UseBasicParsing
Add-AppxPackage -Path $Filename
if($?){
Write-Host " Done" -Foreground Green
}
}
catch{
Write-Host " Failed" -Foreground Red
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment