Skip to content

Commit

Permalink
Merge pull request #1980 from microsoft/dpaul-AppLocationKey
Browse files Browse the repository at this point in the history
Only add key if not already in the list
  • Loading branch information
dpaulson45 authored Feb 8, 2024
2 parents ce42858 + e2fa0ca commit aeb6b6b
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 aeb6b6b

Please sign in to comment.