@@ -38,11 +38,11 @@ RUNNING SCRIPT ANALYZER
38
38
That will analyze your script against every built-in rule. As you may find
39
39
if your script is sufficiently large, that could result in a lot of warnings
40
40
and/or errors. See the next section on recommendations for running against
41
- an existing script or module .
41
+ an existing script, module or DSC resource .
42
42
43
43
To run the script analyzer against a whole directory, specify the folder
44
44
containing the script, module and DSC files you want analyzed. Specify
45
- the Recurse parameter if you also want sub-directories searched for scripts
45
+ the Recurse parameter if you also want sub-directories searched for files
46
46
to analyze.
47
47
48
48
PS C:\> Invoke-ScriptAnalyzer -Path . -Recurse
@@ -59,9 +59,9 @@ RUNNING SCRIPT ANALYZER ON A NEW SCRIPT, MODULE OR DSC RESOURCE
59
59
soon as they occur.
60
60
61
61
Over time, you may find rules that you don't find value in or have a need to
62
- violate the rule . Suppress those rules as necessary but try to avoid
63
- "knee jerk" rule suppression. Analyze the diagnostic output and the part of
64
- your script that violates the rule to be sure you understand the reason for
62
+ explicitly violate . Suppress those rules as necessary but try to avoid
63
+ "knee jerk" suppression of rules . Analyze the diagnostic output and the part
64
+ of your script that violates the rule to be sure you understand the reason for
65
65
the warning and that it is indeed OK to suppress the rule.
66
66
67
67
There are several ways to suppress rules. You can suppress a rule globally
@@ -70,11 +70,11 @@ RUNNING SCRIPT ANALYZER ON A NEW SCRIPT, MODULE OR DSC RESOURCE
70
70
PS C:\> Invoke-ScriptAnalyzer -Path . -ExcludeRule `
71
71
PSProvideDefaultParameterValue, PSAvoidUsingWMICmdlet
72
72
73
- Note that ExcludeRule parameter takes an array of strings i.e. rule names.
73
+ Note that the ExcludeRule parameter takes an array of strings i.e. rule names.
74
74
75
- Sometimes you want to suppress a rule for part of your script but not for
75
+ Sometimes you will want to suppress a rule for part of your script but not for
76
76
the entire script. PSScriptAnalyzer allows you to suppress rules at the
77
- function level as well . You can use the .NET Framework
77
+ script, function and class scope . You can use the .NET Framework
78
78
System.Diagnoctics.CodeAnalysis.SuppressMesssageAttribute in your script
79
79
like so:
80
80
0 commit comments