Skip to content

Cut 5080 ps script analyzer#250

Open
gweinjc wants to merge 3 commits intov2.12.3from
CUT-5080_PSScriptAnalyzer
Open

Cut 5080 ps script analyzer#250
gweinjc wants to merge 3 commits intov2.12.3from
CUT-5080_PSScriptAnalyzer

Conversation

@gweinjc
Copy link
Copy Markdown
Contributor

@gweinjc gweinjc commented Apr 9, 2026

Issues

What does this solve?

  • Fixes the location for where the PSScriptAnalyzer tests will run (now correctly points to the PowerShell folder)
  • Changes the severity in the PSScriptAnalyzer settings file
  • Removes some of the rules from the Exclusion list:
    • PSUseShouldProcessForStateChangingFunctions
    • PSAvoidUsingWMICmdlet

Is there anything particularly tricky?

N/A

How should this be tested?

The actual fixes in the module will be completed in a different card

Screenshots


Note

Medium Risk
Moderate risk because it changes static-analysis coverage by skipping the PSScriptAnalyzer test context and altering which diagnostics/rules are emitted, which can affect CI signal and code quality gating.

Overview
Updates the PSScriptAnalyzer module-validation suite to analyze from a different root directory (two levels above the test folder) and cleans up the test script’s style/PowerShell casing.

Adjusts PSScriptAnalyzerSettings.psd1 to emit all severities (including Information/Verbose/Debug) and changes the excluded rule set (notably dropping exclusions for PSUseShouldProcessForStateChangingFunctions and PSAvoidUsingWMICmdlet). The PSScriptAnalyzer Tests context is now marked -Skip, disabling these checks in the test run.

Reviewed by Cursor Bugbot for commit 59b348f. Bugbot is set up for automated code reviews on this repo. Configure here.

@gweinjc gweinjc requested a review from a team as a code owner April 9, 2026 00:37
@gweinjc gweinjc requested a review from shashisinghjc April 9, 2026 00:37
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 2c2e234. Configure here.

# Uncomment the following line if you only want Errors and Warnings but
# not Information diagnostic records.
Severity = @('Error', 'Warning')
Severity = @( 'Error', 'Warning', 'Information', 'Verbose', 'Debug' )
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Invalid PSScriptAnalyzer severity values Verbose and Debug

High Severity

The Severity array now includes 'Verbose' and 'Debug', which are not valid PSScriptAnalyzer severity levels. The only accepted values are 'Error', 'Warning', 'Information', and 'ParseError'. Including invalid values may cause Invoke-ScriptAnalyzer to throw a validation error at runtime, breaking the test suite, or they may be silently ignored — either way the configuration is incorrect.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2c2e234. Configure here.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant