packer-cn/provisioner/powershell
DanHam 478589abec
Extend upload and subsequent 'dot sourcing' of env vars to std PS command
* Wrap funcs to flatten and upload env vars with new func prepareEnvVars.
  While the wrapped funcs could be combined, keeping them separate
  simplifies testing.
* Configure/refactor std and elevated PS to use new funcs to prepare,
  upload and dot source env vars.
* Dot sourcing the env vars in this way avoids the need to embed them
  directly in the command string. This avoids the need to escape the env
  vars to ensure the command string is correctly parsed.
* Characters within the env vars that are special to PS (such as $'s
  and backticks) will still need to be escaped to allow them to be
  correctly interpreted by PS.
* The std and elevated PS commands now inject env vars into the remote
  env via the same mechanism. This ensures consistent behaviour across the
  two command types.

Fixes #5471
2018-02-08 12:03:18 +00:00
..
elevated.go Move append of portion of command used to send elevated PS output to file 2017-09-26 11:07:26 +01:00
provisioner.go Extend upload and subsequent 'dot sourcing' of env vars to std PS command 2018-02-08 12:03:18 +00:00
provisioner_test.go Revert "Merge pull request #5515 from DanHam/dot-source-env-vars" 2018-02-02 09:58:39 -08:00