You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-3
Original file line number
Diff line number
Diff line change
@@ -318,7 +318,10 @@ Settings Support in ScriptAnalyzer
318
318
Settings that describe ScriptAnalyzer rules to include/exclude based on `Severity` can be created and supplied to
319
319
`Invoke-ScriptAnalyzer` using the `Setting` parameter. This enables a user to create a custom configuration for a specific environment. We support the following modes for specifying the settings file.
320
320
321
-
## Built-in Presets
321
+
## Using parameter Settings
322
+
323
+
### Built-in Presets
324
+
322
325
ScriptAnalyzer ships a set of built-in presets that can be used to analyze scripts. For example, if the user wants to run *PowerShell Gallery* rules on their module, then they use the following command.
Along with `PSGallery` there are a few other built-in presets, including, `DSC` and `CodeFormatting`, that can be used. These presets can be tab completed for the `Settings` parameter.
329
332
330
-
## Explicit
333
+
###Explicit
331
334
332
335
The following example excludes two rules from the default set of rules and any rule
333
336
that does not output an Error or Warning diagnostic record.
@@ -362,7 +365,8 @@ Then invoke that settings file:
If you place a PSScriptAnayzer settings file named `PSScriptAnalyzerSettings.psd1` in your project root, PSScriptAnalyzer will discover it if you pass the project root as the `Path` parameter.
Note that providing settings explicitly takes higher precedence over this implicit mode. Sample settings files are provided [here](https://github.com/PowerShell/PSScriptAnalyzer/tree/master/Engine/Settings).
373
377
378
+
## Custom rules
379
+
380
+
It is possible to provide one or more paths to custom rules in the settings file.
381
+
It is important that these paths either point to a module's folder (implicitly
382
+
uses the module manifest) or to the module's script file (.psm1). The module
383
+
should export the custom rules (as functions) for them to be available to
384
+
PS Script Analyzer.
385
+
386
+
In this example the property `CustomRulePath` points to two different modules.
387
+
Both modules exports the rules (the functions) with the verb `Measure`
0 commit comments