Skip to content

Commit 40bf00c

Browse files
authored
Merge pull request #287 from microsoftgraph/rsh/getLatestVersionPatch
Update getLatestVersion.ps1
2 parents fead581 + 0187cc5 commit 40bf00c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/getLatestVersion.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ $file = get-item $propertiesPath
2323
$findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
2424
$findVersions = $findVersions -split "`r`n"
2525

26-
$majorVersion = $findVersions[0].Substring($findVersions[0].Length-1)
27-
$minorVersion = $findVersions[1].Substring($findVersions[1].Length-1)
28-
$patchVersion = $findVersions[2].Substring($findVersions[2].Length-1)
26+
$versionIndex = $findVersions[0].IndexOf("=")
27+
$majorVersion = $findVersions[0].Substring($versionIndex+2)
28+
$minorVersion = $findVersions[1].Substring($versionIndex+2)
29+
$patchVersion = $findVersions[2].Substring($versionIndex+2)
2930
$version = "$majorVersion.$minorVersion.$patchVersion"
3031

3132
#Update the VERSION_STRING env variable and inform the user
3233
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
33-
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"
34+
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"

0 commit comments

Comments
 (0)