Merge pull request #2256 from jhawkesworth/fix_amc_2147

Fix for ansible-modules-core 2147
This commit is contained in:
Brian Coca 2015-10-13 20:17:28 -04:00
commit 95b10c9fdd

View file

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