Skip to content

Commit

Permalink
Update Get-GhislerTotalCommander.ps1
Browse files Browse the repository at this point in the history
Fix version number string when Minor value is less than 10 #552
  • Loading branch information
aaronparker committed Sep 22, 2023
1 parent 42a87d5 commit 3251b9b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Evergreen/Apps/Get-GhislerTotalCommander.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ function Get-GhislerTotalCommander {
if ($null -ne $Response) {

try {
$Value = ([RegEx]$res.Get.Update.MatchVersion).Match($Response).Groups.Value
$Version = $Value.Split(".")[1,2] -join "."
$VersionString = $Value.Split(".")[1,2] -join ""
$Value = ([Regex]$res.Get.Update.MatchVersion).Match($Response).Groups.Value
$Major = $Value.Split(".")[1]
$Minor = $Value.Split(".")[2]
if ([System.Int16]$Minor -le 9) {
$Minor = "0$Minor"
}
$Version = "$Major.$Minor"
$VersionString = "$Major$Minor"
}
catch {
Write-Warning -Message "$($MyInvocation.MyCommand): Failed to find version number."
$Version = "Unknown"
$VersionString = "Unknown"
}
Expand Down

0 comments on commit 3251b9b

Please sign in to comment.