suggestion by @nitzmahone, to not use Get-Attr in combination with ConvertTo-Bool

This commit is contained in:
Hans-Joachim Kliemeck 2016-03-21 17:49:51 +01:00
parent d5ab52eb58
commit 1c097f9495

View file

@ -88,7 +88,8 @@ Set-Attr $result "changed" $false;
$path = Get-Attr $params "path" -failifempty $true $path = Get-Attr $params "path" -failifempty $true
$user = Get-Attr $params "user" -failifempty $true $user = Get-Attr $params "user" -failifempty $true
$recurse = Get-Attr $params "recurse" "no" -validateSet "no","yes" -resultobj $result | ConvertTo-Bool $recurse = Get-Attr $params "recurse" "no" -validateSet "no","yes" -resultobj $result
$recurse = $recurse | ConvertTo-Bool
If (-Not (Test-Path -Path $path)) { If (-Not (Test-Path -Path $path)) {
Fail-Json $result "$path file or directory does not exist on the host" Fail-Json $result "$path file or directory does not exist on the host"