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]