@@ -11,7 +11,7 @@ def powershell_execute(script, function):
1111 script = re .sub ("Write-Error " ,"Write-Output " , script , flags = re .I )
1212 script = re .sub ("Write-Warning " ,"Write-Output " , script , flags = re .I )
1313
14- fullargs = ["powershell.exe" , "-C" , "-" ]
14+ fullargs = ["powershell.exe" , "-NoProfile" , "-NoLogo" , "- C" , "-" ]
1515
1616 info = subprocess .STARTUPINFO ()
1717 info .dwFlags = sub .STARTF_USESHOWWINDOW
@@ -35,15 +35,12 @@ def powershell_execute(script, function):
3535 p .stdin .write ("Write-Host \" [BEGIN]\" \n " )
3636 p .stdin .write ("Write-Host $b\n " )
3737
38- while True :
39- # begin flag used to remove possible bullshit output print before the function is launched
40- if '[BEGIN]' in p .stdout .readline ():
41- # Get the result in base64
42- for i in p .stdout .readline ():
43- output += i
44- break
45-
46- output = base64 .b64decode (output )
38+ # begin flag used to remove possible bullshit output print before the function is launched
39+ if '[BEGIN]' in p .stdout .readline ():
40+ # Get the result in base64
41+ for i in p .stdout .readline ():
42+ output += i
43+ output = base64 .b64decode (output )
4744 except Exception , e :
4845 pass
4946
0 commit comments