mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
commit
e52d1c6e41
@ -2509,7 +2509,7 @@ def powershell(cmd,
|
|||||||
python_shell = True
|
python_shell = True
|
||||||
|
|
||||||
# Append PowerShell Object formatting
|
# Append PowerShell Object formatting
|
||||||
cmd = "%s | ConvertTo-Json -Depth 32" % cmd
|
cmd = '{0} | ConvertTo-Json -Depth 32'.format(cmd)
|
||||||
|
|
||||||
# Retrieve the response, while overriding shell with 'powershell'
|
# Retrieve the response, while overriding shell with 'powershell'
|
||||||
response = run(cmd,
|
response = run(cmd,
|
||||||
@ -2534,6 +2534,6 @@ def powershell(cmd,
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
return json.loads(response)
|
return json.loads(response)
|
||||||
except:
|
except Exception:
|
||||||
log.error("Error converting PowerShell JSON return", exc_info=True)
|
log.error("Error converting PowerShell JSON return", exc_info=True)
|
||||||
return {}
|
return {}
|
||||||
|
Loading…
Reference in New Issue
Block a user