sort java versions (#3045)

This commit is contained in:
Dibir Magomedsaygitov
2021-03-29 19:19:52 +03:00
committed by GitHub
parent b08f5f471b
commit 826fed9604

View File

@@ -1,6 +1,6 @@
function Get-JavaVersions {
$toolcachePath = Join-Path $env:AGENT_TOOLSDIRECTORY "Java_Adopt_jdk"
$javaToolcacheVersions = Get-ChildItem $toolcachePath -Name | Sort-Object -Descending
$javaToolcacheVersions = Get-ChildItem $toolcachePath -Name | Sort-Object { [int]$_.Split(".")[0] }
return $javaToolcacheVersions | ForEach-Object {
$majorVersion = $_.split(".")[0]