mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 21:09:09 -07:00
fix Windows env handling (#22927)
* fixes #22441 * fixes #22655 * moves all env handling into the exec wrapper; this should work for everything but raw, which is consistent with non-Windows.
This commit is contained in:
parent
f1ab879bb6
commit
73f50b4f9f
8 changed files with 52 additions and 16 deletions
|
@ -305,12 +305,13 @@ class Connection(ConnectionBase):
|
|||
self.shell_id = None
|
||||
self._connect()
|
||||
|
||||
def _create_raw_wrapper_payload(self, cmd):
|
||||
def _create_raw_wrapper_payload(self, cmd, environment=dict()):
|
||||
payload = {
|
||||
'module_entry': base64.b64encode(to_bytes(cmd)),
|
||||
'powershell_modules': {},
|
||||
'actions': ['exec'],
|
||||
'exec': base64.b64encode(to_bytes(leaf_exec))
|
||||
'exec': base64.b64encode(to_bytes(leaf_exec)),
|
||||
'environment': environment
|
||||
}
|
||||
|
||||
return json.dumps(payload)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue