diff --git a/scripts/getLatestVersion.ps1 b/scripts/getLatestVersion.ps1 index d269bcaa8..088034789 100644 --- a/scripts/getLatestVersion.ps1 +++ b/scripts/getLatestVersion.ps1 @@ -23,11 +23,12 @@ $file = get-item $propertiesPath $findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2 $findVersions = $findVersions -split "`r`n" -$majorVersion = $findVersions[0].Substring($findVersions[0].Length-1) -$minorVersion = $findVersions[1].Substring($findVersions[1].Length-1) -$patchVersion = $findVersions[2].Substring($findVersions[2].Length-1) +$versionIndex = $findVersions[0].IndexOf("=") +$majorVersion = $findVersions[0].Substring($versionIndex+2) +$minorVersion = $findVersions[1].Substring($versionIndex+2) +$patchVersion = $findVersions[2].Substring($versionIndex+2) $version = "$majorVersion.$minorVersion.$patchVersion" #Update the VERSION_STRING env variable and inform the user Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)"; -Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version" \ No newline at end of file +Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"