From 833bf77be1101fe77f691b859d4c74e892ed167e Mon Sep 17 00:00:00 2001 From: = Date: Tue, 13 Oct 2015 06:15:25 +0100 Subject: [PATCH] Fix for ansible modules core 2147 --- windows/win_file.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/windows/win_file.ps1 b/windows/win_file.ps1 index f8416120abf..f387780123c 100644 --- a/windows/win_file.ps1 +++ b/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