|
|
@ -277,7 +277,7 @@ class Connection(ConnectionBase):
|
|
|
|
self.module_implementation_preferences = (".ps1", ".exe", "")
|
|
|
|
self.module_implementation_preferences = (".ps1", ".exe", "")
|
|
|
|
self.become_methods = ["runas"]
|
|
|
|
self.become_methods = ["runas"]
|
|
|
|
self.allow_executable = False
|
|
|
|
self.allow_executable = False
|
|
|
|
self.has_pipelining = True
|
|
|
|
self.has_pipelining = False
|
|
|
|
self.allow_extras = True
|
|
|
|
self.allow_extras = True
|
|
|
|
|
|
|
|
|
|
|
|
def _establish_connection(self):
|
|
|
|
def _establish_connection(self):
|
|
|
@ -368,10 +368,13 @@ class Connection(ConnectionBase):
|
|
|
|
|
|
|
|
|
|
|
|
def _get_program_spec_program_path_and_arguments(self, cmd):
|
|
|
|
def _get_program_spec_program_path_and_arguments(self, cmd):
|
|
|
|
if self.windowsGuest:
|
|
|
|
if self.windowsGuest:
|
|
|
|
cmd_parts = self._shell._encode_script(cmd, as_list=False, strict_mode=False, preserve_rc=False)
|
|
|
|
'''
|
|
|
|
|
|
|
|
we need to warp the execution of powershell into a cmd /c because
|
|
|
|
|
|
|
|
the call otherwise fails with "Authentication or permission failure"
|
|
|
|
|
|
|
|
#FIXME: Fix the unecessary invocation of cmd and run the command directly
|
|
|
|
|
|
|
|
'''
|
|
|
|
program_path = "cmd.exe"
|
|
|
|
program_path = "cmd.exe"
|
|
|
|
arguments = "/c %s" % cmd_parts
|
|
|
|
arguments = "/c %s" % cmd
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
program_path = self.get_option("executable")
|
|
|
|
program_path = self.get_option("executable")
|
|
|
|
arguments = re.sub(r"^%s\s*" % program_path, "", cmd)
|
|
|
|
arguments = re.sub(r"^%s\s*" % program_path, "", cmd)
|
|
|
|