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:
Dag Wieers 2017-07-20 23:34:48 +02:00 committed by Jordan Borean
commit 18d9c34e9d
3 changed files with 9 additions and 9 deletions

View file

@ -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