You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A class-based SqlTraceFlag resource would manage the state of SQL Server trace flags, ensuring they are enabled or disabled as required. It would use Get-SqlDscTraceFlag, Add-SqlDscTraceFlag, Remove-SqlDscTraceFlag, and Set-SqlDscTraceFlag.
Proposed properties
Property
Type qualifier
Data type
Description
Default value
Allowed values
Ensure
Key
String
Whether the trace flag should be Present or Absent
Present
Present, Absent
TraceFlag
Key
Int
The trace flag number
None
Valid trace flag numbers
ServerName
Key
String
The SQL Server host name
None
Any valid server name
InstanceName
Key
String
The SQL Server instance name
None
Any valid instance name
Persisted
Write
Boolean
If the trace flag should be persisted
False
True, False
Special considerations or limitations
Should ensure trace flag changes do not disrupt production workloads and support persistence options. Contributors should handle version-specific trace flag behaviors and validation.
Suggest we refactor the MOF-based resource SqlTraceFlag as class-based resource and re-use the commands Get-SqlDscTraceFlag, Remove-SqlDscTraceFlag, Set-SqlDscTraceFlag, Add-SqlDscTraceFlag to simplify the logic of the new class-based resource.
Activity
johlju commentedon Dec 15, 2025
Suggest we refactor the MOF-based resource SqlTraceFlag as class-based resource and re-use the commands Get-SqlDscTraceFlag, Remove-SqlDscTraceFlag, Set-SqlDscTraceFlag, Add-SqlDscTraceFlag to simplify the logic of the new class-based resource.