Add -NoProfile switch

This commit is contained in:
Tadas Medisauskas 2016-12-22 14:50:17 +00:00
parent f6fe8e8755
commit 088d3d1ac8
1 changed files with 6 additions and 4 deletions

View File

@ -138,15 +138,17 @@ func saveScript(fileContents string) (string, error) {
} }
func createArgs(filename string, params ...string) []string { func createArgs(filename string, params ...string) []string {
args := make([]string, len(params)+4) args := make([]string, len(params)+5)
args[0] = "-ExecutionPolicy" args[0] = "-ExecutionPolicy"
args[1] = "Bypass" args[1] = "Bypass"
args[2] = "-File" args[2] = "-NoProfile"
args[3] = filename
args[3] = "-File"
args[4] = filename
for key, value := range params { for key, value := range params {
args[key+4] = value args[key+5] = value
} }
return args return args