From 9f9c565ee629c7a6b31cd719443bcad5ac99f15e Mon Sep 17 00:00:00 2001 From: Kirill Trofimov Date: Fri, 12 Jan 2024 11:21:25 +0100 Subject: [PATCH] Add Microsoft WSL --- Evergreen/Apps/Get-MicrosoftWSL.ps1 | 26 ++++++++++++++++++++++++++ Evergreen/Manifests/MicrosoftWSL.json | 23 +++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Evergreen/Apps/Get-MicrosoftWSL.ps1 create mode 100644 Evergreen/Manifests/MicrosoftWSL.json diff --git a/Evergreen/Apps/Get-MicrosoftWSL.ps1 b/Evergreen/Apps/Get-MicrosoftWSL.ps1 new file mode 100644 index 00000000..dec2e08a --- /dev/null +++ b/Evergreen/Apps/Get-MicrosoftWSL.ps1 @@ -0,0 +1,26 @@ +Function Get-MicrosoftWSL { + <# + .SYNOPSIS + Returns the available Microsoft WSL versions. + + .NOTES + Author: Kirill Trofimov + #> + [OutputType([System.Management.Automation.PSObject])] + [CmdletBinding(SupportsShouldProcess = $False)] + param ( + [Parameter(Mandatory = $False, Position = 0)] + [ValidateNotNull()] + [System.Management.Automation.PSObject] + $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) + ) + + # Pass the repo releases API URL and return a formatted object + $params = @{ + Uri = $res.Get.Uri + MatchVersion = $res.Get.MatchVersion + Filter = $res.Get.MatchFileTypes + } + $object = Get-GitHubRepoRelease @params + Write-Output -InputObject $object +} diff --git a/Evergreen/Manifests/MicrosoftWSL.json b/Evergreen/Manifests/MicrosoftWSL.json new file mode 100644 index 00000000..454a27fa --- /dev/null +++ b/Evergreen/Manifests/MicrosoftWSL.json @@ -0,0 +1,23 @@ +{ + "Name": "Microsoft WSL", + "Source": "https://github.com/microsoft/wsl/", + "Get": { + "Uri": "https://api.github.com/repos/microsoft/wsl/releases/latest", + "MatchVersion": "(\\d+(\\.\\d+){1,4}).*", + "MatchFileTypes": "\\.msixbundle$|\\.msi$" + }, + "Install": { + "Setup": "", + "Preinstall": "", + "Physical": { + "Arguments": "", + "PostInstall": [ + ] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [ + ] + } + } +}