mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
win_command, win_shell: Use Fail-Json on failure (#26512)
Two reasons to do this: - It provides a proper error message indicating why it failed - It conforms to what is being done in the command and shell modules
This commit is contained in:
parent
5617d68c3e
commit
18d9c34e9d
3 changed files with 9 additions and 9 deletions
|
@ -56,7 +56,7 @@ $result.runtime_seconds = $stopwatch.Elapsed.TotalSeconds
|
|||
$result.sent_localtime = $endsend_at.Trim()
|
||||
|
||||
if ($result.rc -ne 0 ) {
|
||||
Fail-Json $result "$output"
|
||||
Fail-Json -obj $result -message "$output"
|
||||
}
|
||||
|
||||
Exit-Json $result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue