From 7fe1ec03ca8c46628c8aa0a309bb599df3685ae7 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 4 Jan 2018 11:34:05 -0800 Subject: [PATCH] update winrmcp to fix #5752 --- vendor/github.com/packer-community/winrmcp/winrmcp/cp.go | 7 ++++++- vendor/vendor.json | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/vendor/github.com/packer-community/winrmcp/winrmcp/cp.go b/vendor/github.com/packer-community/winrmcp/winrmcp/cp.go index 2890e55ef..4d089c13d 100644 --- a/vendor/github.com/packer-community/winrmcp/winrmcp/cp.go +++ b/vendor/github.com/packer-community/winrmcp/winrmcp/cp.go @@ -176,7 +176,12 @@ func cleanupContent(client *winrm.Client, filePath string) error { } defer shell.Close() - script := fmt.Sprintf(`Remove-Item %s -ErrorAction SilentlyContinue`, filePath) + script := fmt.Sprintf(` + $tmp_file_path = [System.IO.Path]::GetFullPath("%s") + if (Test-Path $tmp_file_path) { + Remove-Item $tmp_file_path -ErrorAction SilentlyContinue + } + `, filePath) cmd, err := shell.Execute(winrm.Powershell(script)) if err != nil { diff --git a/vendor/vendor.json b/vendor/vendor.json index a229cabce..4438b367e 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -983,10 +983,10 @@ "revision": "179d4d0c4d8d407a32af483c2354df1d2c91e6c3" }, { - "checksumSHA1": "XXmfaQ8fEupEgaGd6PptrLnrE54=", + "checksumSHA1": "/NoE6t3UkW4/iKAtbf59GGv6tF8=", "path": "github.com/packer-community/winrmcp/winrmcp", - "revision": "e1b7d6e6b1b1a27984270784190f1d06ad91888b", - "revisionTime": "2017-09-29T21:51:32Z" + "revision": "81144009af586de8e7729b829266f09dd0d59701", + "revisionTime": "2018-01-02T16:08:24Z" }, { "checksumSHA1": "oaXvjFg802gS/wx1bx2gAQwa7XQ=",