From fecb040bf4aec803c8fae9449c0b3b24655cc841 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 25 May 2020 02:54:27 -0700 Subject: [PATCH] fix bug where build vars couldn't be properly interpolated into this execute command (#9275) --- provisioner/powershell/provisioner.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/provisioner/powershell/provisioner.go b/provisioner/powershell/provisioner.go index ab1fbe820..d5cd46e2d 100644 --- a/provisioner/powershell/provisioner.go +++ b/provisioner/powershell/provisioner.go @@ -371,10 +371,11 @@ func (p *Provisioner) createRemoteCleanUpCommand(remoteFiles []string) (string, return "", fmt.Errorf("clean up script %q failed to upload: %s", remotePath, err) } - data := map[string]string{ - "Path": remotePath, - "Vars": p.config.RemoteEnvVarPath, - } + data := p.generatedData + data["Path"] = remotePath + data["Vars"] = p.config.RemoteEnvVarPath + p.config.ctx.Data = data + p.config.ctx.Data = data return interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) }