Files
runner-images-sangeeth/images/windows/scripts/build/Install-WSL2.ps1
2025-02-17 10:05:54 -07:00

17 lines
553 B
PowerShell

Write-Host "Install WSL2"
$version = (Get-GithubReleasesByVersion -Repo "microsoft/WSL" -Version "latest").version
$downloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "microsoft/WSL" `
-Version $version `
-UrlMatchPattern "wsl.*.x64.msi"
Install-Binary -Type MSI `
-Url $downloadUrl `
-ExpectedSHA256Sum "3CC2866BE450210BDD7A7449DF96E0B1EAE25067EE348631A5B9BFC62C943740"
Write-Host "Performing wsl --install --no-distribution"
wsl.exe --install --no-distribution
Invoke-PesterTests -TestFile "WindowsFeatures" -TestName "WSL2"