Skip to content
Permalink
Browse files

Use get-command to auto-resolve packer path

Resolves #279
  • Loading branch information...
clong committed Jun 20, 2019
1 parent 528633a commit b162255275f2632f968e20b04358f4c46f011a09
Showing with 6 additions and 1 deletion.
  1. +6 −1 build.ps1
@@ -74,7 +74,12 @@ function install_checker {
}

function check_packer {
#Check for packer at $PackerPath
# Check for packer using Get-Command
if ((Get-Command packer).Path) {
$PackerPath = (Get-Command packer).Path
Write-Output "Packer found at $PackerPath"
}
# Check for packer at $PackerPath
if (!(Test-Path $PackerPath)) {
Write-Error "Packer not found at $PackerPath"
Write-Output 'Re-run the script setting the PackerPath parameter to the location of packer'

0 comments on commit b162255

Please sign in to comment.
You can’t perform that action at this time.