Closed
Description
Hi there!
My apologies if this has already been covered.
PSAvoidUninitializedVariable seems to flag automatic PowerShell variables, such as $Matches and $PSBoundParameters.
Example code:
"hi there!" -match "hi" | Out-Null
$matches[0]
Resulting warning:
Variable 'matches' is not initialized. Non-global variables must be initialized. To fix a violation of this rule, pl
ease initialize non-global variables.
Cheers!