Skip to content

Unable to set RuleSuppressionID in DiagnosticRecord object from custom powershell rule #1143

@jegannathanmaniganadan

Description

@jegannathanmaniganadan

I have been trying to set RuleSuppressionID in the [Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord]::new() object from a custom Powershell rules. But for some reason that is not working. Not sure if PSSA removes the property before writing it out

I could see that DiagnosticRecord constructor takes value for RuleSuppressionID.

{
            Message  = message;
            RuleName = ruleName;
            Extent   = extent;
            Severity = severity;
            ScriptPath = scriptPath;
            RuleSuppressionID = ruleId;
            this.suggestedCorrections = suggestedCorrections;
}

@bergmeister

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions