diff --git a/RuleDocumentation/ProvideDefaultParameterValue.md b/RuleDocumentation/ProvideDefaultParameterValue.md new file mode 100644 index 000000000..5569e266e --- /dev/null +++ b/RuleDocumentation/ProvideDefaultParameterValue.md @@ -0,0 +1,30 @@ +#ProvideDefaultParameterValue +**Severity Level: Warning** + + +##Description +Parameters must have a default value as uninitialized parameters will lead to potential bugs in the scripts. + +##How to Fix + +To fix a violation of this rule, please specify a default value for all parameters. + +##Example + +Wrong: + +``` +function Test($Param1) +{ + $Param1 +} +``` + +Correct: + +``` +function Test($Param1 = $null) +{ + $Param1 +} +```