Skip to content

Commit 5fa4d99

Browse files
committed
Update README.md
1 parent f722975 commit 5fa4d99

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,26 @@ To match all functions/variables/parameters/objects, use `*` as the value of the
118118
)
119119

120120

121+
Profile support in ScriptAnalyzer
122+
========================================
123+
124+
Profiles that describe ScriptAnalyzer rules to include/exclude based on `Severity` can be created and supplied to `Invoke-ScriptAnalyzer` using the `-profile` parameter. This enables a user to create custom configuration for a specific environment.
125+
126+
Using Profile support:
127+
128+
```powershell
129+
$myProfile = @{
130+
Severity='Warning'
131+
IncludeRules=@('PSAvoidUsingCmdletAliases',
132+
'PSAvoidUsingPositionalParameters',
133+
'PSAvoidUsingInternalURLs'
134+
'PSAvoidUninitializedVariable')
135+
ExcludeRules=@('PSAvoidUsingCmdletAliases'
136+
'PSAvoidUninitializedVariable')
137+
}
138+
139+
Invoke-ScriptAnalyzer -path MyScript.ps1 -Profile $myProfile
140+
```
121141

122142

123143
Building the Code

0 commit comments

Comments
 (0)