You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
876 B
PowerShell
21 lines
876 B
PowerShell
function Search-PythonVersionsNotOnImage {
|
|
param (
|
|
[string]$ToolName,
|
|
[string]$ReleasesUrl,
|
|
[string]$FilterParameter,
|
|
[string]$FilterArch
|
|
)
|
|
|
|
$stableReleases = (Invoke-RestMethod $ReleasesUrl) |
|
|
Where-Object stable -eq $true |
|
|
ForEach-Object {$_.$FilterParameter.split(".")[0,1] -join"."} |
|
|
Select-Object -Unique
|
|
$toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/toolsets/toolset-2022.json"
|
|
$latestVersion = ((Invoke-RestMethod $toolsetUrl).toolcache |
|
|
Where-Object {$_.name -eq $ToolName -and $_.arch -eq $FilterArch}).versions |
|
|
Select-Object -Last 1
|
|
$latestMinorVesion = $latestVersion.TrimEnd(".*")
|
|
$versionsToAdd = $stableReleases | Where-Object {[version]$_ -gt [version]$latestMinorVesion}
|
|
|
|
return $versionsToAdd
|
|
} |