Merge pull request #5369 from DanHam/gh-5368-psenvvar

Use system context env var to set path for elevated PS env vars file
This commit is contained in:
SwampDragons 2017-09-25 15:47:16 -07:00 committed by GitHub
commit 08a52f1c57
1 changed files with 1 additions and 1 deletions

View File

@ -417,7 +417,7 @@ func (p *Provisioner) createCommandTextPrivileged() (command string, err error)
// we'll be dot-sourcing this later
envVarReader := strings.NewReader(flattenedEnvVars)
uuid := uuid.TimeOrderedUUID()
envVarPath := fmt.Sprintf(`${env:TEMP}\packer-env-vars-%s.ps1`, uuid)
envVarPath := fmt.Sprintf(`${env:SYSTEMROOT}\Temp\packer-env-vars-%s.ps1`, uuid)
log.Printf("Uploading env vars to %s", envVarPath)
err = p.communicator.Upload(envVarPath, envVarReader, nil)
if err != nil {