[windows] Fix output for packer 1.7.1 (#3104)

This commit is contained in:
Mikhail Timofeev
2021-04-06 05:06:39 +03:00
committed by GitHub
parent 0d102a98d4
commit 6ede984b96

View File

@@ -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 "(?<version>(\d+.){2}\d+)" | Out-Null
$packerVersion = $Matches.Version
return "Packer $packerVersion"
}
function Get-PulumiVersion {