Skip to content

Commit d6dc001

Browse files
MWL88JamesWTruher
authored andcommitted
Fix typo (#942)
Update script rule function parameters description
1 parent 6146546 commit d6dc001

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ScriptRuleDocumentation.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PSScriptAnalyzer uses MEF(Managed Extensibility Framework) to import all rules d
44

55
When calling Invoke-ScriptAnalyzer, users can specify custom rules using the parameter `CustomizedRulePath`.
66

7-
The purpose of this documentation is to server as a basic guide on creating your own customized rules.
7+
The purpose of this documentation is to serve as a basic guide on creating your own customized rules.
88

99
### Basics
1010

@@ -29,7 +29,7 @@ The purpose of this documentation is to server as a basic guide on creating your
2929
[OutputType([Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord[]])]
3030
```
3131

32-
- Make sure each function takes either a Token or an Ast as a parameter
32+
- Make sure each function takes either a Token array or an Ast as a parameter. The _Ast_ parameter name must end with 'Ast' and the _Token_ parameter name must end with 'Token'
3333

3434
``` PowerShell
3535
Param
@@ -41,6 +41,16 @@ Param
4141
)
4242
```
4343

44+
``` PowerShell
45+
Param
46+
(
47+
[Parameter(Mandatory = $true)]
48+
[ValidateNotNullOrEmpty()]
49+
[System.Management.Automation.Language.Token[]]
50+
$testToken
51+
)
52+
```
53+
4454
- DiagnosticRecord should have four properties: Message, Extent, RuleName and Severity
4555

4656
``` PowerShell

0 commit comments

Comments
 (0)