diff --git a/Diagnostics/HealthChecker/Features/Get-HealthCheckerData.ps1 b/Diagnostics/HealthChecker/Features/Get-HealthCheckerData.ps1 index cd88896cd6..0209fcfb30 100644 --- a/Diagnostics/HealthChecker/Features/Get-HealthCheckerData.ps1 +++ b/Diagnostics/HealthChecker/Features/Get-HealthCheckerData.ps1 @@ -113,6 +113,8 @@ function Get-HealthCheckerData { } catch { Write-Red "Failed to Health Checker against $serverName" $failedServerList.Add($serverName) + # Try to handle the issue so we don't get a false positive report. + Invoke-CatchActions continue } diff --git a/Diagnostics/HealthChecker/HealthChecker.ps1 b/Diagnostics/HealthChecker/HealthChecker.ps1 index 3bc5e6cabc..aa46bf459c 100644 --- a/Diagnostics/HealthChecker/HealthChecker.ps1 +++ b/Diagnostics/HealthChecker/HealthChecker.ps1 @@ -172,6 +172,7 @@ begin { . $PSScriptRoot\..\..\Shared\LoggerFunctions.ps1 . $PSScriptRoot\..\..\Shared\OutputOverrides\Write-Host.ps1 . $PSScriptRoot\..\..\Shared\OutputOverrides\Write-Verbose.ps1 + . $PSScriptRoot\..\..\Shared\OutputOverrides\Write-Warning.ps1 . $PSScriptRoot\..\..\Shared\ScriptUpdateFunctions\Test-ScriptVersion.ps1 $BuildVersion = "" @@ -192,6 +193,7 @@ begin { -ErrorAction SilentlyContinue SetProperForegroundColor SetWriteVerboseAction ${Function:Write-DebugLog} + SetWriteWarningAction ${Function:Write-DebugLog} } process { $Server | ForEach-Object { $Script:ServerNameList.Add($_.ToUpper()) } } end {