File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,12 +38,17 @@ jobs:
3838 Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
3939 Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
4040
41- Invoke-WebRequest -Uri https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -OutFile wsl_update.msi
42- Start-Process msiexec.exe -Wait -ArgumentList '/i wsl_update.msi /quiet'
43-
4441 wsl --set-default-version 2
4542 wsl --update
46- wsl --install -d Ubuntu
43+
44+ $distros = (Invoke-RestMethod -Uri https://raw.githubusercontent.com/microsoft/WSL/refs/heads/master/distributions/DistributionInfo.json).Distributions
45+ $distroDownloadUrl = $distros.Where({ $_.Name -eq 'Ubuntu' }).Amd64PackageUrl
46+ Set-Location $env:GITHUB_WORKSPACE\..\..
47+ $filename = "Ubuntu$([System.IO.Path]::GetExtension($distroDownloadUrl))"
48+ Invoke-WebRequest -Uri $distroDownloadUrl -OutFile $filename
49+ Expand-Archive -Path $filename -DestinationPath .\
50+ $distroExe = (Get-ChildItem -Path . -Filter *.exe).Where({ $_.Name -notmatch 'splash|setup' }).FullName
51+ & $distroExe install --root
4752
4853 @'
4954 @echo off
You can’t perform that action at this time.
0 commit comments