From 183430628be245d15c69fbe4c356eef8e8c1a895 Mon Sep 17 00:00:00 2001 From: "jhawkesworth@users.noreply.github.com" Date: Tue, 13 Oct 2015 06:15:25 +0100 Subject: [PATCH] Fix for ansible modules core 2147 --- lib/ansible/modules/windows/win_file.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/windows/win_file.ps1 b/lib/ansible/modules/windows/win_file.ps1 index f8416120abf..f387780123c 100644 --- a/lib/ansible/modules/windows/win_file.ps1 +++ b/lib/ansible/modules/windows/win_file.ps1 @@ -71,18 +71,15 @@ If (Test-Path $path) } Else { - # Only files have the .Directory attribute. - If ( $state -eq "directory" -and $fileinfo.Directory ) + If ( $state -eq "directory" -and -not $fileinfo.PsIsContainer ) { Fail-Json (New-Object psobject) "path is not a directory" } - # Only files have the .Directory attribute. - If ( $state -eq "file" -and -not $fileinfo.Directory ) + If ( $state -eq "file" -and $fileinfo.PsIsContainer ) { Fail-Json (New-Object psobject) "path is not a file" } - } } Else