Merge pull request #1116 from marcind/devel

Fix IIS module null refs when removing objects on a server running PowerShell 4
reviewable/pr18780/r1
Matt Davis 10 years ago
commit 445daf372d

@ -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