From ce0412aa8570e7ccdaa193337354e58d13f9073f Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Tue, 29 Nov 2016 14:19:51 -0800 Subject: [PATCH] Fix test failures in win_command/win_shell on Powershell 3 Switched to use Exit-Json to avoid JSON escaping bugs in ConvertTo-Json formatter without -Compress option. --- lib/ansible/modules/windows/win_command.ps1 | 2 +- lib/ansible/modules/windows/win_shell.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/windows/win_command.ps1 b/lib/ansible/modules/windows/win_command.ps1 index 2a03b6a03d5..316654b81d7 100644 --- a/lib/ansible/modules/windows/win_command.ps1 +++ b/lib/ansible/modules/windows/win_command.ps1 @@ -158,4 +158,4 @@ $result.start = $start_datetime.ToString("yyyy-MM-dd hh:mm:ss.ffffff") $result.end = $end_datetime.ToString("yyyy-MM-dd hh:mm:ss.ffffff") $result.delta = $($end_datetime - $start_datetime).ToString("h\:mm\:ss\.ffffff") -ConvertTo-Json -Depth 99 $result +Exit-Json $result diff --git a/lib/ansible/modules/windows/win_shell.ps1 b/lib/ansible/modules/windows/win_shell.ps1 index 850f2b9561a..664858e52ca 100644 --- a/lib/ansible/modules/windows/win_shell.ps1 +++ b/lib/ansible/modules/windows/win_shell.ps1 @@ -139,4 +139,4 @@ $result.start = $start_datetime.ToString("yyyy-MM-dd hh:mm:ss.ffffff") $result.end = $end_datetime.ToString("yyyy-MM-dd hh:mm:ss.ffffff") $result.delta = $($end_datetime - $start_datetime).ToString("h\:mm\:ss\.ffffff") -ConvertTo-Json -Depth 99 $result +Exit-Json $result