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

pull/18777/head
Marcin Dobosz 9 years ago committed by Matt Clay
parent 092c3ccbde
commit 6f68db5c1a

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

Loading…
Cancel
Save