as suggested by @marcind, convert to boolean

reviewable/pr18780/r1
Hans-Joachim Kliemeck 9 years ago
parent 7978afe1fd
commit 3a5d4576c6

@ -91,7 +91,7 @@ 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 $recurse = Get-Attr $params "recurse" "no" -validateSet "no","yes" -resultobj $result | 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"
@ -117,7 +117,7 @@ Try {
$acl.setOwner($objUser) $acl.setOwner($objUser)
Set-Acl $file.FullName $acl Set-Acl $file.FullName $acl
If ($recurse -eq "yes") { If ($recurse) {
$files = Get-ChildItem -Path $path -Force -Recurse $files = Get-ChildItem -Path $path -Force -Recurse
ForEach($file in $files){ ForEach($file in $files){
$acl = Get-Acl $file.FullName $acl = Get-Acl $file.FullName

Loading…
Cancel
Save