From 6ede984b964bcc31124454c436da49e637b39ec0 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Tue, 6 Apr 2021 05:06:39 +0300 Subject: [PATCH] [windows] Fix output for packer 1.7.1 (#3104) --- images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 690f36764..ec3213421 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -112,7 +112,10 @@ function Get-OpenSSLVersion { } function Get-PackerVersion { - return "Packer $(packer --version)" + # Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855 + ($(cmd /c "packer --version 2>&1") | Out-String) -match "(?(\d+.){2}\d+)" | Out-Null + $packerVersion = $Matches.Version + return "Packer $packerVersion" } function Get-PulumiVersion {