GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Filter Invoke-ScriptAnalyzer results by diagnostic severity by Copilot · Pull Request #2268 · PowerShell/PSScriptAnalyzer

Conversation

Copilot AI commented Oct 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Invoke-ScriptAnalyzer -Severity filtered rules by their configured severity instead of filtering the diagnostics those rules emitted. This could hide diagnostics whose severity differed from the rule’s severity, including errors from custom rules.

  • Filter diagnostics: Apply -Severity to emitted diagnostic records, including parse errors and suppressed records.
  • Run rules independently: Severity no longer determines which rules execute.

For example, -Severity Error now includes an Error diagnostic emitted by a custom rule configured as Warning:

Invoke-ScriptAnalyzer -ScriptDefinition 'Invoke-Something' `
    -CustomRulePath ./CustomRule.psm1 `
    -Severity Error
  • Fixes Invoke-ScriptAnalyzer -Severity filters rules rather than diagnostics #2156

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Initial plan
2fbea9e
Copilot AI assigned Copilot and Christoph Bergmeister (bergmeister) Oct 27, 2026
Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 22:33
View session
Copilot AI linked an issue Oct 27, 2026 that may be closed by this pull request
Invoke-ScriptAnalyzer -Severity filters rules rather than diagnostics #2156
Open
@bergmeister
Filter Invoke-ScriptAnalyzer by diagnostic severity
3a7fed2
Co-authored-by: bergmeister <[email protected]>
Copilot AI changed the title [WIP] Fix -Severity parameter to filter diagnostics correctly Filter Invoke-ScriptAnalyzer results by diagnostic severity Oct 27, 2026
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 22:41
Copilot AI requested a review from Christoph Bergmeister (bergmeister) October 27, 2026 22:41
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 28, 2026 11:35
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 28, 2026 11:36
View session
Copilot AI reviewed Oct 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The severity-filter change lacks regression tests confirming correct filtering and suppression metadata preservation under both -SuppressedOnly and -IncludeSuppressed.

1 open issue
  • Low severity Add severity filter coverage for suppressed records · New
What changed in this PR

Updates Invoke-ScriptAnalyzer -Severity to filter emitted diagnostics rather than select which rules execute, aligning behavior with the documented contract and addressing #2156.

Changes:

  • Filters diagnostics by severity, including parse errors and suppressed records.
  • Adds a regression test for a custom rule whose diagnostic severity differs from its configured severity.
  • Clarifies the severity parameter’s source-code documentation.
File Description
Tests/​Engine/​CustomizedRule.tests.ps1 Tests custom-rule diagnostic severity filtering.
Engine/​ScriptAnalyzer.cs Moves severity filtering from rule selection to diagnostic output.
Engine/​Commands/​InvokeScriptAnalyzerCommand.cs Corrects the severity property’s documentation comment.

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Engine/ScriptAnalyzer.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 28, 2026 14:06
View session
@bergmeister
Test severity filtering of suppressed custom diagnostics
28e40a1
Co-authored-by: bergmeister <[email protected]>

Copilot AI commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

🟡 Changes recommended...

Added coverage for both suppression modes, severity filtering, and suppression metadata in 28e40a1.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 28, 2026 14:10
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 28, 2026 14:37
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 28, 2026 14:37
View session
Copilot AI reviewed Oct 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change aligning severity filtering with its documented behavior.

1 open issue
  • Low severity Add severity filter coverage for suppressed records

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 28, 2026 14:42
View session
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 28, 2026 14:44
@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as ready for review October 28, 2026 14:48
@bergmeister
Christoph Bergmeister (bergmeister) requested a review from a team as a code owner October 28, 2026 14:48
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 28, 2026 14:48
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 28, 2026 14:48
View session
Copilot AI reviewed Oct 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the diagnostic-severity filtering change.

No open issues 🎉

1 resolved since last review
  • Low severity Add severity filter coverage for suppressed records

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@bergmeister Christoph Bergmeister (bergmeister) Awaiting requested review from bergmeister bergmeister is a code owner

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@bergmeister Christoph Bergmeister (bergmeister)

Copilot code review Copilot

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Invoke-ScriptAnalyzer -Severity filters rules rather than diagnostics

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bergmeister
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.