mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -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,10 @@ $ErrorActionPreference = "Stop"
|
|||
# POWERSHELL_COMMON
|
||||
|
||||
$params = Parse-Args $args;
|
||||
$result = New-Object PSObject;
|
||||
Set-Attr $result "changed" $false;
|
||||
|
||||
$result = @{
|
||||
changed = $false
|
||||
}
|
||||
|
||||
function Invoke-NGen
|
||||
{
|
||||
|
@ -42,11 +44,11 @@ function Invoke-NGen
|
|||
if (test-path $cmd)
|
||||
{
|
||||
$update = Invoke-Expression "$cmd update /force";
|
||||
Set-Attr $result "dotnet_ngen$($arity)_update_exit_code" $lastexitcode
|
||||
Set-Attr $result "dotnet_ngen$($arity)_update_output" $update
|
||||
$(result.dotnet_ngen$($arity)_update_exit_code) = $lastexitcode
|
||||
$(result.dotnet_ngen$($arity)_update_output) = $update
|
||||
$eqi = Invoke-Expression "$cmd executequeueditems";
|
||||
Set-Attr $result "dotnet_ngen$($arity)_eqi_exit_code" $lastexitcode
|
||||
Set-Attr $result "dotnet_ngen$($arity)_eqi_output" $eqi
|
||||
$(result.dotnet_ngen$($arity)_eqi_exit_code) = $lastexitcode
|
||||
$(result.dotnet_ngen$($arity)_eqi_output) = $eqi
|
||||
|
||||
$result.changed = $true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue