From 210e9558ae4af7de565ee5e7bdcdc73d71b1fffb Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Mon, 5 Apr 2021 18:41:57 +0300 Subject: [PATCH] [macOS] Fix output for packer 1.7.1 (#3100) --- images/macos/software-report/SoftwareReport.Common.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index 7786c7ade..3aff25aff 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -293,7 +293,9 @@ function Get-SVNVersion { } function Get-PackerVersion { - $packerVersion = Run-Command "packer --version" + # Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855 + $result = Run-Command -Command "packer --version" + $packerVersion = [regex]::matches($result, "(\d+.){2}\d+").Value return "Packer $packerVersion" }