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 +}