Skip to content

Commit 70cedfa

Browse files
committed
remove banner if one exists
Former-commit-id: bba39c3 [formerly bba39c3 [formerly bba39c3 [formerly 838e77f]]] Former-commit-id: a3b325046d7d404351a02459c6ae8a7ac11e25c6 Former-commit-id: 30be7df Former-commit-id: 6201ac2
1 parent ab64288 commit 70cedfa

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Windows/lazagne/config/powershell_execute.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)