diff --git a/powershell/powershell.go b/powershell/powershell.go index 5553995b..320fb791 100644 --- a/powershell/powershell.go +++ b/powershell/powershell.go @@ -41,7 +41,9 @@ func UploadCmd(path string) string { // EncodeCmd base64-encodes a string in a way that is accepted by PowerShell -EncodedCommand func EncodeCmd(psCmd string) string { - psCmd = "$ProgressPreference='SilentlyContinue'; " + psCmd + if !strings.Contains(psCmd, "begin {") { + psCmd = "$ProgressPreference='SilentlyContinue'; " + psCmd + } // 2 byte chars to make PowerShell happy wideCmd := "" for _, b := range []byte(psCmd) {