I'm sorry to say it's not currently possible. The shell-local post-processor has some hardcoded assumptions that the shell in question is sh: https://github.com/hashicorp/packer/blob/4dcf9d760b2fd549ddad85837e78e0ed64620a5e/post-processor/shell-local/communicator.go#L16But all is not lost. I have a pretty hefty rewrite of the code used for the shell-local provisioner and post-processors scheduled for the 1.3.0 release (https://github.com/hashicorp/packer/pull/5956) which, among other things, should make this possible. I've attached a windows build of that PR if you'd like to test it out; I could use some community validation that it solves these kinds of less common cases.Example of running a powershell script on windows:Required customizations: env_var_format and execute_command{"type": "shell-local","environment_vars": ["SHELLLOCALTEST=ShellTest4"],"execute_command": ["powershell.exe", "{{.Vars}} {{.Script}}"],"env_var_format": "$env:%s=\"%s\"; ","script": "./scripts/example_ps.ps1"}Example of running a powershell script on windows as "inline":Required customizations: env_var_format, tempfile_extension, and execute_command{"type": "shell-local","tempfile_extension": ".ps1","environment_vars": ["SHELLLOCALTEST=ShellTest5"],"execute_command": ["powershell.exe", "{{.Vars}} {{.Script}}"],"env_var_format": "$env:%s=\"%s\"; ","inline": ["write-output $env:SHELLLOCALTEST"]}Thanks!Megan
--
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 packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a641b13a-dee6-44ae-9b6d-4c0623bd8039%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.