From 9f109aeef615abca8bac24e3401f88d3af256e5b Mon Sep 17 00:00:00 2001 From: Mark Leach Date: Wed, 21 Mar 2018 09:11:01 +0000 Subject: [PATCH] Fix typo Update script rule function parameters description --- ScriptRuleDocumentation.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ScriptRuleDocumentation.md b/ScriptRuleDocumentation.md index f7bdd00db..dca9151e8 100644 --- a/ScriptRuleDocumentation.md +++ b/ScriptRuleDocumentation.md @@ -4,7 +4,7 @@ PSScriptAnalyzer uses MEF(Managed Extensibility Framework) to import all rules d When calling Invoke-ScriptAnalyzer, users can specify custom rules using the parameter `CustomizedRulePath`. -The purpose of this documentation is to server as a basic guide on creating your own customized rules. +The purpose of this documentation is to serve as a basic guide on creating your own customized rules. ### Basics @@ -29,7 +29,7 @@ The purpose of this documentation is to server as a basic guide on creating your [OutputType([Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord[]])] ``` -- Make sure each function takes either a Token or an Ast as a parameter +- 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' ``` PowerShell Param @@ -41,6 +41,16 @@ Param ) ``` +``` PowerShell +Param +( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Management.Automation.Language.Token[]] + $testToken +) +``` + - DiagnosticRecord should have four properties: Message, Extent, RuleName and Severity ``` PowerShell