Skip to content

Add Get-ScriptAnalyzerSetting cmdlet to generalize a way of displaying collections of rules #1740

Open
@sdwheeler

Description

@sdwheeler

Summary of the new feature

As a user I want to be able to discover what rules are defined in a PSD1 file, especially those that are included with PSScriptAnalyzer. I would also like to point to any PSD1 file containing rules and get the same output.

Proposed technical implementation details (optional)

Example 1 - Get the settings in the CmdletDesign PSD1 file that is included with PSScriptAnalyer

Get-ScriptAnalyzerSetting -Settings CmdletDesign

The default output should be the same as running Get-ScriptAnalyzerRule on each rule in the PSD1.

Example 2 - Get the settings in the CmdletDesign PSD1 file and show the configuration

Get-ScriptAnalyzerSetting -Settings CmdletDesign -Configuration

Adding the configuration switch should display the rule name and any custom configuration settings for rules that allow configuration.

Example 3 - Get the settings in a user provided PSD1 file

Get-ScriptAnalyzerSetting -Path /path/to/myrules.psd1

The output should be the same and the Path parameter set should also allow the Configuration parameter.

Other considerations

If the PSD1 file can contain both inclusions and exclusions, then the out needs to indicate which rules are included and which are excluded. Consider grouping by include/exclude.

Current version = 1.20.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions