From db45f3fcac8ea4648e950a12ec84fcade2c06204 Mon Sep 17 00:00:00 2001 From: Leonid Lapshin Date: Fri, 28 Aug 2020 10:25:28 +0300 Subject: [PATCH] the Github CLI version fix for short version number (#1468) * the Github CLI version fix for short version number * select the string with version in command output, get the version without date Co-authored-by: Leonid Lapshin --- images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 6ce6b5b1e..fb550ee62 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -222,7 +222,9 @@ function Get-NewmanVersion { } function Get-GHVersion { - return "GitHub CLI $(gh --version)" + ($(gh --version) | Select-String -Pattern "gh version") -match "gh version (?\d+\.\d+\.\d+)" | Out-Null + $ghVersion = $Matches.Version + return "GitHub CLI $ghVersion" } function Get-VisualCPPComponents {