Invoke-sqmPerfBaseline
PerformancesqmSQLTool v1.8.2+ · Diagnostics
sys.dm_os_wait_stats and sys.dm_os_performance_counters. Supports three actions: Capture (save baseline), Compare (delta between two baselines), List (list all saved files).Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string | Optional | $env:COMPUTERNAME | Target SQL Server instance. |
| -SqlCredential | PSCredential | Optional | — | Credentials for the connection. |
| -Action | string | Optional | Capture | Capture | Compare | List |
| -BaselineName | string | Optional | Timestamp | Label for snapshot (Capture action). |
| -BaselineA, -BaselineB | string | Optional | Auto-detect | Baselines for comparison (Compare action). |
| -OutputPath | string | Optional | Config + \PerfBaseline | Directory for JSON baseline files. |
| -EnableException | switch | Optional | $false | Re-throw exceptions. |
Execution Flow
Examples
Capture baseline before a change
Invoke-sqmPerfBaseline -SqlInstance "SQL01" -BaselineName "before_patch"
Capture after change, then compare
Invoke-sqmPerfBaseline -SqlInstance "SQL01" -BaselineName "after_patch" Invoke-sqmPerfBaseline -SqlInstance "SQL01" -Action Compare