File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def execute_WithOutput(self, command):
6767 self .__registry_Path = f"Software\\ Classes\\ { gen_random_string (8 )} "
6868
6969 # 1. Run the command and write output to file
70- self .execute_remote (f'{ self .__shell } { command } 1> "{ result_output } " 2>&1' )
70+ self .execute_remote (f'{ self .__shell } ( { command } ) 1> "{ result_output } " 2>&1' )
7171 self .logger .info (f"Waiting { self .__exec_timeout } s for command to complete." )
7272 time .sleep (self .__exec_timeout )
7373
@@ -109,7 +109,7 @@ def execute_WithOutput_psh(self, command):
109109
110110 # 1. Run the command and write output to file
111111 if not command .lower ().startswith ("powershell" ):
112- command = f" powershell -Command { command } "
112+ command = f' powershell -Command "& {{ { command } }}"'
113113 self .execute_remote (f'{ command } > "{ result_output } " 2>&1' )
114114 self .logger .info (f"Waiting { self .__exec_timeout } s for command to complete." )
115115 time .sleep (self .__exec_timeout )
You can’t perform that action at this time.
0 commit comments