Set-sqmMaxMemory
SQL Config sqmSQLTool v1.8.2+
Sets SQL Server "max server memory (MB)" to the recommended (or an explicit) value.

Examples

Set-sqmMaxMemory -SqlInstance SQL01
Set-sqmMaxMemory -SqlInstance SQL01
    Sets max server memory to 90% of physical RAM.
Set-sqmMaxMemory -SqlInstance SQL01 -MaxMemoryMB 24576
Set-sqmMaxMemory -SqlInstance SQL01 -MaxMemoryMB 24576
    Sets max server memory to exactly 24 GB.
Set-sqmMaxMemory -SqlInstance SQL01 -RecommendedPct 80 -WhatIf
Set-sqmMaxMemory -SqlInstance SQL01 -RecommendedPct 80 -WhatIf
    Shows what would be set (80% of RAM) without changing anything.