Skip to content

SqlTraceFlag: New resource proposal #2170

Open

Description

@johlju

Resource proposal

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.

Activity

  1. added
    enhancementThe issue is an enhancement request.
    help wantedThe issue is up for grabs for anyone in the community.
    resource proposalThe issue is proposing a new resource in the resource module.
    on Sep 6, 2025
  2. johlju commented on Dec 15, 2025

    @johlju
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.resource proposalThe issue is proposing a new resource in the resource module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions