Merge pull request #4317 from Tadas/fix-ps-noprofile
Add -NoProfile switch for PowerShell execution
This commit is contained in:
commit
3824ea157d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue