From 02aa66ed9105bf7cd76d61d7e6a02492631e65dc Mon Sep 17 00:00:00 2001 From: David Paulson Date: Fri, 6 Dec 2024 09:21:43 -0600 Subject: [PATCH] Address math rounding issue for dynamic memory detection --- .../Analyzer/Invoke-AnalyzerHardwareInformation.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerHardwareInformation.ps1 b/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerHardwareInformation.ps1 index 8cb714a26..1d2eb5011 100644 --- a/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerHardwareInformation.ps1 +++ b/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerHardwareInformation.ps1 @@ -252,6 +252,7 @@ function Invoke-AnalyzerHardwareInformation { } $totalPhysicalMemory = [System.Math]::Round($hardwareInformation.TotalMemory / 1024 / 1024 / 1024) + $totalPhysicalMemoryNotRounded = $hardwareInformation.TotalMemory / 1GB $displayWriteType = "Yellow" $displayDetails = [string]::Empty @@ -310,7 +311,8 @@ function Invoke-AnalyzerHardwareInformation { if ($null -eq $counter) { $params.Details = "Unknown - Required Counter Not Loaded" $params.DisplayWriteType = "Yellow" - } elseif (($counter.CookedValue / 1024) -ne $totalPhysicalMemory) { + } elseif (($counter.CookedValue / 1024) -ne $totalPhysicalMemory -and + ($counter.CookedValue / 1024) -ne $totalPhysicalMemoryNotRounded) { $params.Details = "$true $($counter.CookedValue / 1024)GB is the allowed dynamic memory of the server. Not supported to have dynamic memory configured." $params.DisplayWriteType = "Red" }