diff --git a/Diagnostics/HealthChecker/Analyzer/Get-IISAuthenticationType.ps1 b/Diagnostics/HealthChecker/Analyzer/Get-IISAuthenticationType.ps1 index b735855d17..1fa42b511f 100644 --- a/Diagnostics/HealthChecker/Analyzer/Get-IISAuthenticationType.ps1 +++ b/Diagnostics/HealthChecker/Analyzer/Get-IISAuthenticationType.ps1 @@ -106,7 +106,11 @@ function Get-IISAuthenticationType { # for this configuration type, clear flag doesn't appear to be used at all. foreach ($appKey in $appHostConfigLocations) { Write-Verbose "Working on appKey: $appKey" - $getIisAuthenticationType.Add($appKey, [string]::Empty) + + if (-not ($getIisAuthenticationType.ContainsKey($appKey))) { + $getIisAuthenticationType.Add($appKey, [string]::Empty) + } + $currentKey = $appKey $authentication = @() $continue = $true diff --git a/Diagnostics/HealthChecker/Analyzer/Get-IPFilterSetting.ps1 b/Diagnostics/HealthChecker/Analyzer/Get-IPFilterSetting.ps1 index ce7564eb62..ddf440ac37 100644 --- a/Diagnostics/HealthChecker/Analyzer/Get-IPFilterSetting.ps1 +++ b/Diagnostics/HealthChecker/Analyzer/Get-IPFilterSetting.ps1 @@ -16,7 +16,11 @@ function Get-IPFilterSetting { process { foreach ($appKey in $locationPaths) { Write-Verbose "Working on appKey: $appKey" - $ipFilterSettings.Add($appKey, (New-Object System.Collections.Generic.List[object])) + + if (-not ($ipFilterSettings.ContainsKey($appKey))) { + $ipFilterSettings.Add($appKey, (New-Object System.Collections.Generic.List[object])) + } + $currentKey = $appKey $continue = $true