File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ The PSScriptAnalyzer contains the following rule definitions.
6868| [ UseCompatibleSyntax] ( ./UseCompatibleSyntax.md ) | Warning | No | Yes |
6969| [ UseCompatibleTypes] ( ./UseCompatibleTypes.md ) | Warning | No | Yes |
7070| [ UseConsistentIndentation] ( ./UseConsistentIndentation.md ) | Warning | No | Yes |
71- | [ UseConsistentParameterSetName] ( ./UseConsistentParameterSetName.md ) | Warning | Yes | |
71+ | [ UseConsistentParameterSetName] ( ./UseConsistentParameterSetName.md ) | Warning | No | |
7272| [ UseConsistentWhitespace] ( ./UseConsistentWhitespace.md ) | Warning | No | Yes |
7373| [ UseCorrectCasing] ( ./UseCorrectCasing.md ) | Information | No | Yes |
7474| [ UseDeclaredVarsMoreThanAssignments] ( ./UseDeclaredVarsMoreThanAssignments.md ) | Warning | Yes | |
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ The rule performs five different checks:
21214 . ** Case mismatch between different ParameterSetName values** - Ensures all references to the same parameter set use identical casing
22225 . ** Parameter set names containing newlines** - Warns against using newline characters in parameter set names
2323
24+ > [ !NOTE]
25+ > This rule is not enabled by default. The user needs to enable it through settings.
26+
2427## How
2528
2629- Use a ` DefaultParameterSetName ` when defining multiple parameter sets
@@ -108,6 +111,22 @@ function Get-Data {
108111}
109112```
110113
114+ ## Configuration
115+
116+ ``` powershell
117+ Rules = @{
118+ PSUseConsistentParameterSetName = @{
119+ Enable = $true
120+ }
121+ }
122+ ```
123+
124+ ### Parameters
125+
126+ - ` Enable ` : ** bool** (Default value is ` $false ` )
127+
128+ Enable or disable the rule during ScriptAnalyzer invocation.
129+
111130## Notes
112131
113132- Parameter set names are case-sensitive in PowerShell, making this different from most other PowerShell elements
You can’t perform that action at this time.
0 commit comments