From 4a07ea61a8d7d558b29ad088e4621561426859b6 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 15 Sep 2020 09:20:45 +0300 Subject: [PATCH] fix gem output --- images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 3 ++- images/linux/scripts/SoftwareReport/SoftwareReport.Rust.psm1 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index f36ab2b20..64a9d1c3f 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -88,7 +88,8 @@ function Get-HomebrewVersion { } function Get-GemVersion { - $(gem --version 2>&1) -match "(?\d+\.\d+\.\d+)" | Out-Null + $result = Get-CommandResult "gem --version" + $result.Output -match "(?\d+\.\d+\.\d+)" | Out-Null $gemVersion = $Matches.version return "Gem $gemVersion" } diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Rust.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Rust.psm1 index 640ad2cf8..e822a5c38 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Rust.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Rust.psm1 @@ -2,6 +2,7 @@ function Initialize-RustEnvironment { ln -sf "/usr/share/rust/.rustup" $HOME/.rustup ln -sf "/usr/share/rust/.cargo" $HOME/.cargo } + function Get-RustVersion { Initialize-RustEnvironment $rustVersion = $(rustc --version) | Take-OutputPart -Part 1