diff options
author | Dag Wieers <dag@wieers.com> | 2017-01-18 12:51:02 +0100 |
---|---|---|
committer | John R Barker <john@johnrbarker.com> | 2017-01-18 11:51:02 +0000 |
commit | 74ecbebf7a710d066608db79f86f95d45a7438ec (patch) | |
tree | e4f76f4b255be023639b3737fc745bf4d3e9446e | |
parent | e9704b389b6dfabd38bafb64a6befb499db59ff9 (diff) | |
download | ansible-74ecbebf7a710d066608db79f86f95d45a7438ec.tar.gz |
win_unzip: Fix for working 'creates' (#20352)
Also fix an incorrect Exit-Json call.
-rw-r--r-- | lib/ansible/modules/windows/win_unzip.ps1 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/modules/windows/win_unzip.ps1 b/lib/ansible/modules/windows/win_unzip.ps1 index b91712f2be..4972481162 100644 --- a/lib/ansible/modules/windows/win_unzip.ps1 +++ b/lib/ansible/modules/windows/win_unzip.ps1 @@ -29,8 +29,9 @@ $result = New-Object psobject @{ $creates = Get-AnsibleParam -obj $params -name "creates" -type "path" If ($creates -ne $null) { - If (Test-Path $params.creates) { - Exit-Json $result "The 'creates' file or directory already exists." + If (Test-Path $creates) { + $result.msg = "The 'creates' file or directory ($creates) already exists." + Exit-Json $result } } @@ -139,4 +140,4 @@ Set-Attr $result.win_unzip "src" $src.toString() Set-Attr $result.win_unzip "dest" $dest.toString() Set-Attr $result.win_unzip "recurse" $recurse.toString() -Exit-Json $result; +Exit-Json $result |