Bug Report
General Troubleshooting steps
Does (Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()

Version Information
- Operating System (Name|Version): Windows 10|1803
- PowerShell Version: 5.1.17134.858
- dbachecks Version: 2.0.9
- dbatools Version: 1.0.140
- PSFramework Version: 1.1.59
- Pester Version: 4.10.1
- SQL Server (Edition|Version): Standard Edition (64-bit)|14.0.3294.2
Steps to Reproduce
PS C:\Users\aic1> Test-DbaMaxMemory -SqlInstance SIRBNM-TEST23\SIRSQL6 -SqlCredential (Get-Credential sa)
WARNING: [17:10:52][Test-DbaMaxMemory] Couldn't get accurate SQL Server instance count on SIRBNM-TEST23\SIRSQL6. Defaulting to 1. | No services found in relevant namespaces on SIRBNM-TEST23.
Please note that this function is available from SQL 2005 up.
ComputerName : SIRBNM-TEST23
InstanceName : SIRSQL6
SqlInstance : SIRBNM-TEST23\SIRSQL6
InstanceCount : 1
Total : 16377
MaxValue : 2147483647
RecommendedValue : 11257
PS C:\Users\aic1> Invoke-DbcCheck -Checks MaxMemory -SqlInstance SIRBNM-TEST23\SIRSQL6 -SqlCredential (Get-Credential sa)
Pester v4.10.1
Executing all tests in 'C:\Program Files\WindowsPowerShell\Modules\dbachecks\2.0.9\checks\Instance.Tests.ps1' with Tags MaxMemory
Executing script C:\Program Files\WindowsPowerShell\Modules\dbachecks\2.0.9\checks\Instance.Tests.ps1
Describing Max Memory
Context Testing Max Memory on SIRBNM-TEST23\SIRSQL6
[+] Max Memory setting should be correct on SIRBNM-TEST23\SIRSQL6 380ms
Tests completed in 1.05s
Tests Passed: 1, Failed: 0, Skipped: 0, Pending: 0, Inconclusive: 0
Description of Bug
MaxMemory check succeeds against an SQL Server instance with Max Memory value greater than (Recommended+379), when it shouldn't.
Workaround
Replace
$psitem.SqlMaxMB | Should -BeLessThan ($psitem.RecommendedMB + 379) -Because 'You do not want to exhaust server memory'
with
$psitem.MaxValue | Should -BeLessThan ($psitem.RecommendedValue + 379) -Because 'You do not want to exhaust server memory'
in <ModulePath>\dbachecks\<Version>\checks\Instance.Tests.ps1
Bug Report
General Troubleshooting steps
Does
(Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()powershell -NoProfile)?Version Information
Steps to Reproduce
Run
Invoke-DbcCheck -Checks MaxMemoryagainst an SQL Server instance with default max memory settings (2147483647).Attach any screenshots (if possible/allowed)
Attach output from PowerShell console (if possible/allowed)
Description of Bug
MaxMemory check succeeds against an SQL Server instance with Max Memory value greater than (Recommended+379), when it shouldn't.
Workaround
Replace
$psitem.SqlMaxMB | Should -BeLessThan ($psitem.RecommendedMB + 379) -Because 'You do not want to exhaust server memory'with
$psitem.MaxValue | Should -BeLessThan ($psitem.RecommendedValue + 379) -Because 'You do not want to exhaust server memory'in
<ModulePath>\dbachecks\<Version>\checks\Instance.Tests.ps1