From 01e6fb95400cb3837b9a18a3a944b0f45cfc4136 Mon Sep 17 00:00:00 2001 From: ChristianOe <39793553+ChristianOe@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:03:36 +0100 Subject: [PATCH] Update Test-AppList.ps1 Improved ConvertTo-Version because [Version] only accepts MajorVersion.MinorVersion.Revision.Build. The Evergreen Module for Amazon Corretto gives more then 4 Values like 1.2.3.4.5. [Version] allows only 1.2.3.4 with powershell 5. --- Scripts/Test-AppList.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Scripts/Test-AppList.ps1 b/Scripts/Test-AppList.ps1 index 99c34b0..2614833 100644 --- a/Scripts/Test-AppList.ps1 +++ b/Scripts/Test-AppList.ps1 @@ -54,6 +54,12 @@ Process { # Split the version string by non-numerical characters and then join them by a period to construct the version number $ConvertVersion = ($Version -split "\D") -join "." + #If Version has more then 4 Values, then cut them (e.g 1.2.3.4.5 to 1.2.3.4) + $VersionSplit = $ConvertVersion.split("\.") + If (($VersionSplit).Count -gt 4){ + $ConvertVersion = "$($VersionSplit[0]).$($VersionSplit[1]).$($VersionSplit[2]).$($VersionSplit[3])" + } + # Return the converted version number return $ConvertVersion } @@ -501,4 +507,4 @@ Process { Write-Output -InputObject "##vso[task.setvariable variable=shouldrun;isOutput=true]false" throw "$($MyInvocation.MyCommand): Failed to retrieve authentication token with error message: $($_.Exception.Message)" } -} \ No newline at end of file +}