Skip to content

Commit

Permalink
Only add key if not already in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaulson45 committed Feb 8, 2024
1 parent ce42858 commit e2fa0ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion Diagnostics/HealthChecker/Analyzer/Get-IPFilterSetting.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e2fa0ca

Please sign in to comment.