mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Windows: Get rid of Set-Attr in remaining modules (#23525)
Only a few more modules were using Set-Attr on the $result object rather than using a normal hashtable. This PR changes the PSObject to a hashtable and gets rid of Set-Attr.
This commit is contained in:
parent
94bd647bc0
commit
246c84b92a
7 changed files with 37 additions and 31 deletions
|
@ -22,8 +22,9 @@
|
|||
|
||||
$params = Parse-Args $args;
|
||||
|
||||
$result = New-Object PSObject;
|
||||
Set-Attr $result "changed" $false;
|
||||
$result = @{
|
||||
changed = $false
|
||||
}
|
||||
|
||||
$path = Get-Attr $params "path" -failifempty $true
|
||||
$state = Get-Attr $params "state" "absent" -validateSet "present","absent" -resultobj $result
|
||||
|
@ -66,7 +67,7 @@ Try {
|
|||
}
|
||||
|
||||
Set-ACL $path $objACL
|
||||
Set-Attr $result "changed" $true;
|
||||
$result.changed = $true
|
||||
}
|
||||
Elseif (($state -eq "absent") -And $inheritanceEnabled) {
|
||||
If ($reorganize) {
|
||||
|
@ -76,7 +77,7 @@ Try {
|
|||
}
|
||||
|
||||
Set-ACL $path $objACL
|
||||
Set-Attr $result "changed" $true;
|
||||
$result.changed = $true
|
||||
}
|
||||
}
|
||||
Catch {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue