Repository: microsoft/CSS-Exchange
File: Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerIISInformation.ps1 (PowerShell)

Code before:
                    IndentSpaces  = 8
                })
            AddHtmlDetailRow = $false
        }
        Add-AnalyzedResultInformation @params

        if ($alreadyDisplayedUrlRewriteRules[$urlMatchProblem].Count -gt 0) {
            $params = $baseParams + @{
                Name             = "Misconfigured URL Rewrite Rule - URL Match Problem Rules"
                Details          = "$([string]::Join(",", $alreadyDisplayedUrlRewriteRules[$urlMatchProblem]))" +
                "`r`n`t`tURL Match is set only a wild card which will result in a HTTP 500." +
                "`r`n`t`tIf the rule is required, the URL match should be '.*' to avoid issues."
                DisplayWriteType = "Red"
            }

            Add-AnalyzedResultInformation @params
        }
    }

    foreach ($webApp in $iisWebApplications) {
        if ($correctLocations.ContainsKey($webApp.FriendlyName)) {
            if ($webApp.PhysicalPath -notlike "*$($correctLocations[$webApp.FriendlyName])") {
                $params = $baseParams + @{
                    Name             = "Incorrect Virtual Directory Path"
                    Details          = "Error: '$($webApp.FriendlyName)' location for the virtual directory configuration is incorrect." +
                    "`r`n`t`tCurrently pointing to '$($webApp.PhysicalPath)'. Which is incorrect for this protocol and will cause problems."
                    DisplayWriteType = "Red"
                }
                Add-AnalyzedResultInformation @params
            }
        }
    }

    if ($null -ne $missingWebApplicationConfigFile) {
        $params = $baseParams + @{
            Name                = "Missing Web Application Configuration File"
            DisplayWriteType    = "Red"
            DisplayTestingValue = $true
        }
        Add-AnalyzedResultInformation @params

        foreach ($webApp in $missingWebApplicationConfigFile) {
            $params = $baseParams + @{
                Details                = "Web Application: '$($webApp.FriendlyName)' Attempting to use config: '$($webApp.ConfigurationFileInfo.Location)'"
                DisplayWriteType       = "Red"
                DisplayCustomTabNumber = 2
                TestingName            = "Web Application: '$($webApp.FriendlyName)'"
                DisplayTestingValue    = $($webApp.ConfigurationFileInfo.Location)
            }
            Add-AnalyzedResultInformation @params
        }

Review comment (bug):
```suggestion
                    "`r`n`t`tCurrently pointing to '$($webApp.PhysicalPath)', which is incorrect for this protocol and will cause problems."
```

Nit: should this be a `,` instead of `.`?

Code after:
                    IndentSpaces  = 8
                })
            AddHtmlDetailRow = $false
        }
        Add-AnalyzedResultInformation @params

        if ($alreadyDisplayedUrlRewriteRules[$urlMatchProblem].Count -gt 0) {
            $params = $baseParams + @{
                Name             = "Misconfigured URL Rewrite Rule - URL Match Problem Rules"
                Details          = "$([string]::Join(",", $alreadyDisplayedUrlRewriteRules[$urlMatchProblem]))" +
                "`r`n`t`tURL Match is set only a wild card which will result in a HTTP 500." +
                "`r`n`t`tIf the rule is required, the URL match should be '.*' to avoid issues."
                DisplayWriteType = "Red"
            }

            Add-AnalyzedResultInformation @params
        }
    }

    foreach ($webApp in $iisWebApplications) {
        if ($correctLocations.ContainsKey($webApp.FriendlyName)) {
            if ($webApp.PhysicalPath -notlike "*$($correctLocations[$webApp.FriendlyName])") {
                $params = $baseParams + @{
                    Name             = "Incorrect Virtual Directory Path"
                    Details          = "Error: '$($webApp.FriendlyName)' location for the virtual directory configuration is incorrect." +
                    "`r`n`t`tCurrently pointing to '$($webApp.PhysicalPath)', which is incorrect for this protocol and will cause problems."
                    DisplayWriteType = "Red"
                }
                Add-AnalyzedResultInformation @params
            }
        }
    }

    if ($null -ne $missingWebApplicationConfigFile) {
        $params = $baseParams + @{
            Name                = "Missing Web Application Configuration File"
            DisplayWriteType    = "Red"
            DisplayTestingValue = $true
        }
        Add-AnalyzedResultInformation @params

        foreach ($webApp in $missingWebApplicationConfigFile) {
            $params = $baseParams + @{
                Details                = "Web Application: '$($webApp.FriendlyName)' Attempting to use config: '$($webApp.ConfigurationFileInfo.Location)'"
                DisplayWriteType       = "Red"
                DisplayCustomTabNumber = 2
                TestingName            = "Web Application: '$($webApp.FriendlyName)'"
                DisplayTestingValue    = $($webApp.ConfigurationFileInfo.Location)
            }
            Add-AnalyzedResultInformation @params
        }