Fix win_iis_webapppool module to not null ref when removing an apppool using PS4

reviewable/pr18780/r1
Marcin Dobosz 9 years ago committed by Marcin Dobosz
parent 2850c7acb8
commit aee09745d3

@ -101,12 +101,15 @@ try {
# Result # Result
$pool = Get-Item IIS:\AppPools\$name $pool = Get-Item IIS:\AppPools\$name
$result.info = @{ if ($pool)
name = $pool.Name {
state = $pool.State $result.info = @{
attributes = New-Object psobject @{} name = $pool.Name
}; state = $pool.State
attributes = New-Object psobject @{}
$pool.Attributes | ForEach { $result.info.attributes.Add($_.Name, $_.Value)}; };
$pool.Attributes | ForEach { $result.info.attributes.Add($_.Name, $_.Value)};
}
Exit-Json $result Exit-Json $result

Loading…
Cancel
Save