Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiagnosticRecord should support ToString() #1945

Closed
StartAutomating opened this issue Oct 10, 2023 · 0 comments · Fixed by #1946
Closed

DiagnosticRecord should support ToString() #1945

StartAutomating opened this issue Oct 10, 2023 · 0 comments · Fixed by #1946
Milestone

Comments

@StartAutomating
Copy link
Contributor

Script Analyzer records use the default ToString(), which merely displays the type.

This means that to test the result of a script analyzer record with a regex, one needs to dig into subproperties.

It also means that records will not render ideally when stringified.

Proposed technical implementation details (optional)

[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord] should override .ToString() method to output the message.

StartAutomating pushed a commit to StartAutomating/PSScriptAnalyzer that referenced this issue Oct 10, 2023
@SydneyhSmith SydneyhSmith added this to the 1.22 milestone Oct 24, 2023
JamesWTruher pushed a commit that referenced this issue Jan 16, 2024
#1946)

* Adding DiagnosticRecord.ToString() (Fixes #1945)

* Adding CorrectionExtent.ToString() (Fixes #1944)

---------

Co-authored-by: James Brundage <@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants