File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Import-Module PSScriptAnalyzer
2- $ruleName = " PSUseConsistentIndentation"
2+ $settings = @ {
3+ IncludeRules = @ (" PSUseConsistentIndentation" )
4+ Rules = @ {
5+ PSUseConsistentIndentation = @ {
6+ Enable = $true
7+ IndentationSize = 4
8+ }
9+ }
10+ }
11+
312
413Describe " UseConsistentIndentation" {
514 Context " When top level indentation is not consistent" {
@@ -10,7 +19,8 @@ Describe "UseConsistentIndentation" {
1019
1120}
1221'@
13- $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - IncludeRule $ruleName
22+
23+ $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
1424 }
1525
1626 It " Should detect a violation" {
@@ -26,7 +36,7 @@ function foo ($param1)
2636"abc"
2737}
2838'@
29- $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - IncludeRule $ruleName
39+ $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
3040 }
3141
3242 It " Should detect a violation" {
You can’t perform that action at this time.
0 commit comments