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
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Table of Contents
32
32
33
33
<!-- tocstop -->
34
34
35
-
Introduction
35
+
Introduction[↑](#table-of-contents)
36
36
============
37
37
PSScriptAnalyzer is a static code checker for Windows PowerShell modules and scripts. PSScriptAnalyzer checks the quality of Windows PowerShell code by running a set of rules.
38
38
The rules are based on PowerShell best practices identified by PowerShell Team and the community. It generates DiagnosticResults (errors and warnings) to inform users about potential
@@ -41,15 +41,16 @@ code defects and suggests possible solutions for improvements.
41
41
PSScriptAnalyzer is shipped with a collection of built-in rules that checks various aspects of PowerShell code such as presence of uninitialized variables, usage of PSCredential Type,
42
42
usage of Invoke-Expression etc. Additional functionalities such as exclude/include specific rules are also supported.
@@ -134,7 +135,7 @@ cd /path/to/PSScriptAnalyzer/Tests/Rules
134
135
Invoke-Pester
135
136
```
136
137
137
-
Suppressing Rules
138
+
Suppressing Rules[↑](#table-of-contents)
138
139
=================
139
140
140
141
You can suppress a rule by decorating a script/function or script/function parameter with .NET's [SuppressMessageAttribute](https://msdn.microsoft.com/en-us/library/system.diagnostics.codeanalysis.suppressmessageattribute.aspx).
@@ -219,7 +220,7 @@ Param()
219
220
220
221
**Note**: Rule suppression is currently supported only for built-in rules.
221
222
222
-
Settings Support in ScriptAnalyzer
223
+
Settings Support in ScriptAnalyzer[↑](#table-of-contents)
223
224
========================================
224
225
Settings that describe ScriptAnalyzer rules to include/exclude based on `Severity` can be created and supplied to
225
226
`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.
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).
270
271
271
-
ScriptAnalyzer as a .NET library
272
+
ScriptAnalyzer as a .NET library[↑](#table-of-contents)
272
273
================================
273
274
274
275
ScriptAnalyzer engine and functionality can now be directly consumed as a library.
@@ -292,7 +293,7 @@ public System.Collections.Generic.IEnumerable<DiagnosticRecord> AnalyzePath(stri
0 commit comments