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

Code before:
                    DisplayWriteType       = "Yellow"
                    TestingName            = "Common $($service.Name)"
                }
                Add-AnalyzedResultInformation @params
            }
        }

        if ($exchangeInformation.DependentServices.Misconfigured.Count -gt 0) {
            Write-Verbose "Misconfigured Services found."
            Add-AnalyzedResultInformation -Name "Misconfigured Services" @baseParams

            foreach ($service in $exchangeInformation.DependentServices.Misconfigured) {
                $params = $baseParams + @{
                    Details                = "$($service.Name) - Status: $($service.Status) - StartType: $($service.StartType) - CorrectStartType: $($service.CorrectStartType)"
                    DisplayCustomTabNumber = 2
                    DisplayWriteType       = "Yellow"
                }
                Add-AnalyzedResultInformation @params
            }
        }
    }

    if ($exchangeInformation.GetExchangeServer.IsEdgeServer -eq $false -and
        $null -ne $exchangeInformation.ExtendedProtectionConfig) {
        $params = $baseParams + @{
            Name    = "Extended Protection Enabled (Any VDir)"
            Details = $exchangeInformation.ExtendedProtectionConfig.ExtendedProtectionConfigured
        }
        Add-AnalyzedResultInformation @params

        # If any directory has a higher than expected configuration, we need to throw a warning
        # This will be detected by SupportedExtendedProtection being set to false, as we are set higher than expected/recommended value you will likely run into issues of some kind
        # Skip over Default Web Site/Powershell if RequireSsl is not set.
        $notSupportedExtendedProtectionDirectories = $exchangeInformation.ExtendedProtectionConfig.ExtendedProtectionConfiguration |
            Where-Object { ($_.SupportedExtendedProtection -eq $false -and
                    $_.VirtualDirectoryName -ne "Default Web Site/Powershell") -or
                ($_.SupportedExtendedProtection -eq $false -and
                $_.VirtualDirectoryName -eq "Default Web Site/Powershell" -and
                $_.Configuration.SslSettings.RequireSsl -eq $true)
            }

        if ($null -ne $notSupportedExtendedProtectionDirectories) {
            foreach ($entry in $notSupportedExtendedProtectionDirectories) {
                $expectedValue = if ($entry.MitigationSupported -and $entry.MitigationEnabled) { "None" } else { $entry.ExpectedExtendedConfiguration }
                $params = $baseParams + @{
                    Details                = "$($entry.VirtualDirectoryName) - Current Value: '$($entry.ExtendedProtection)'   Expected Value: '$expectedValue'"
                    DisplayWriteType       = "Yellow"
                    DisplayCustomTabNumber = 2
                    TestingName            = "EP - $($entry.VirtualDirectoryName)"
                    DisplayTestingValue    = ($entry.ExtendedProtection)
                }

Review comment (suggestion):
```suggestion
                Details                = "To determine the display name of the service that is not properly configured or running, run 'Get-Service <Name>' to get more information."
```

Code after:
                    DisplayWriteType       = "Yellow"
                    TestingName            = "Common $($service.Name)"
                }
                Add-AnalyzedResultInformation @params
            }
        }

        if ($exchangeInformation.DependentServices.Misconfigured.Count -gt 0) {
            Write-Verbose "Misconfigured Services found."
            Add-AnalyzedResultInformation -Name "Misconfigured Services" @baseParams

            foreach ($service in $exchangeInformation.DependentServices.Misconfigured) {
                $params = $baseParams + @{
                    Details                = "$($service.Name) - Status: $($service.Status) - StartType: $($service.StartType) - CorrectStartType: $($service.CorrectStartType)"
                    DisplayCustomTabNumber = 2
                    DisplayWriteType       = "Yellow"
                }
                Add-AnalyzedResultInformation @params
            }
        }

        if ($exchangeInformation.DependentServices.Critical.Count -gt 0 -or
            $exchangeInformation.DependentServices.Common.Count -gt 0 -or
            $exchangeInformation.DependentServices.Misconfigured.Count -gt 0) {
            $params = $baseParams + @{
                Details                = "To determine what the display name of the service that is not properly configured or running, run 'Get-Service <Name>' to get more information."
                DisplayCustomTabNumber = 2
                DisplayWriteType       = "Yellow"
            }
            Add-AnalyzedResultInformation @params
        }
    }

    if ($exchangeInformation.GetExchangeServer.IsEdgeServer -eq $false -and
        $null -ne $exchangeInformation.ExtendedProtectionConfig) {
        $params = $baseParams + @{
            Name    = "Extended Protection Enabled (Any VDir)"
            Details = $exchangeInformation.ExtendedProtectionConfig.ExtendedProtectionConfigured
        }
        Add-AnalyzedResultInformation @params

        # If any directory has a higher than expected configuration, we need to throw a warning
        # This will be detected by SupportedExtendedProtection being set to false, as we are set higher than expected/recommended value you will likely run into issues of some kind
        # Skip over Default Web Site/Powershell if RequireSsl is not set.
        $notSupportedExtendedProtectionDirectories = $exchangeInformation.ExtendedProtectionConfig.ExtendedProtectionConfiguration |
            Where-Object { ($_.SupportedExtendedProtection -eq $false -and
                    $_.VirtualDirectoryName -ne "Default Web Site/Powershell") -or
                ($_.SupportedExtendedProtection -eq $false -and
                $_.VirtualDirectoryName -eq "Default Web Site/Powershell" -and
                $_.Configuration.SslSettings.RequireSsl -eq $true)
            }