From 088d3d1ac8080099f37d5641f9e43aa0aef43aa5 Mon Sep 17 00:00:00 2001 From: Tadas Medisauskas Date: Thu, 22 Dec 2016 14:50:17 +0000 Subject: [PATCH] Add -NoProfile switch --- common/powershell/powershell.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/powershell/powershell.go b/common/powershell/powershell.go index ed8b5a6f0..423bcd857 100644 --- a/common/powershell/powershell.go +++ b/common/powershell/powershell.go @@ -138,15 +138,17 @@ func saveScript(fileContents string) (string, error) { } func createArgs(filename string, params ...string) []string { - args := make([]string, len(params)+4) + args := make([]string, len(params)+5) args[0] = "-ExecutionPolicy" args[1] = "Bypass" - args[2] = "-File" - args[3] = filename + args[2] = "-NoProfile" + + args[3] = "-File" + args[4] = filename for key, value := range params { - args[key+4] = value + args[key+5] = value } return args