don't use -File, breaks existing script args. will figure out another way to deal with spaces if using custom tmpdir

This commit is contained in:
wh1te909 2023-05-10 18:56:49 -07:00
parent 5adb986f7f
commit 569a6662f0

View File

@ -143,7 +143,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int,
switch shell { switch shell {
case "powershell": case "powershell":
exe = getPowershellExe() exe = getPowershellExe()
cmdArgs = []string{"-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", tmpfn.Name()} cmdArgs = []string{"-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", tmpfn.Name()}
case "python": case "python":
exe = a.PyBin exe = a.PyBin
cmdArgs = []string{tmpfn.Name()} cmdArgs = []string{tmpfn.Name()}