From 826fed960459993d41c2f9310d220b7cf2c015e8 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov <61747324+dibir-magomedsaygitov@users.noreply.github.com> Date: Mon, 29 Mar 2021 19:19:52 +0300 Subject: [PATCH] sort java versions (#3045) --- images/linux/scripts/SoftwareReport/SoftwareReport.Java.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Java.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Java.psm1 index 5be0e8f97..ae13eab9a 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Java.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Java.psm1 @@ -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]