Commands / Get-sqmTempDbRecommendation
Get-sqmTempDbRecommendation
Configuration sqmSQLTool v1.8.2+ · Best Practices
Analyzes the current TempDB configuration and provides optimization recommendations.

Checks:
File count: compares against CPU core count (ideal: min of CPU cores and 8)
File sizes: alerts if unequal
Autogrow: recommends MB-based growth instead of percent
Drive placement: recommends separate drives if all files are on the same drive

Returns status (OK / Warning / Info) and list of recommendations.

Parameters

ParameterTypeRequiredDefaultNotes
-SqlInstancestringOptional$env:COMPUTERNAMETarget SQL Server instance.
-SqlCredentialPSCredentialOptionalCredentials for the connection.
-OutputPathstringOptionalOptional CSV export path.
-EnableExceptionswitchOptional$falseRe-throw exceptions instead of returning $null.

Output

Returns a [PSCustomObject] with:
SqlInstance — target instance
Status — OK, Warning, or Info
FileCount — current number of TempDB files
RecommendedCount — ideal file count
FileSizesMB — array of current file sizes
GrowthMB — array of autogrow values
Paths — array of file paths
Recommendations — combined message string

Examples

Check local instance TempDB configuration
Get-sqmTempDbRecommendation -SqlInstance "SQL01"
Check TempDB and export results to CSV
Get-sqmTempDbRecommendation -SqlInstance "SQL01" -OutputPath "D:\Reports\tempdb-rec.csv"