From 700ca56c61fe58848f00ecfc0a51b47524a670f8 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Kliemeck Date: Wed, 21 Oct 2015 21:11:51 +0200 Subject: [PATCH] as suggested by @marcind, convert to boolean --- lib/ansible/modules/extras/windows/win_owner.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/windows/win_owner.ps1 b/lib/ansible/modules/extras/windows/win_owner.ps1 index 519d6fe5802..eb69e744e63 100644 --- a/lib/ansible/modules/extras/windows/win_owner.ps1 +++ b/lib/ansible/modules/extras/windows/win_owner.ps1 @@ -91,7 +91,7 @@ Set-Attr $result "changed" $false; $path = Get-Attr $params "path" -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)) { Fail-Json $result "$path file or directory does not exist on the host" @@ -117,7 +117,7 @@ Try { $acl.setOwner($objUser) Set-Acl $file.FullName $acl - If ($recurse -eq "yes") { + If ($recurse) { $files = Get-ChildItem -Path $path -Force -Recurse ForEach($file in $files){ $acl = Get-Acl $file.FullName