execute_command is where we wet the environment vars -- in the example
above, we dot-source them from a file using the ". {{.Vars}}" portion of
the command -- {{ .Vars }} is the golang templating method for adding items
into a string, and in this case .Vars gets replaced with a formatted
version of the variables you supply in environment_vars.  I imagine you
should be able to use the environment vars in the command, as long as you
have already called the code that sources {{Vars}}

So you'd want something like

"execute_command": "powershell -executionpolicy bypass \"& {. {{.Vars}};
Set-Location -Path C:\\artifacts\\windows-netfx3; &'{{.Path}}'; exit
$LastExitCode }\""

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAGPV1upAWyEfgBcMnf-NFyAGDRNgQRu5Bk6VaVLe0KAExE0JjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to