Closed
Description
This rule should not exist at all
Function parameters are always automatically defined in the local scope and initialized by PowerShell to their default value (the equivalent of null -- which comes out as an empty string or a zero for numerical values, or a default struct, etc)
This happens even when they are part of an unused parameter set.
There is absolutely ZERO value, and nothing to be gained in setting them yourself -- unless you actually need them to default to something other than $null
.
If anything, this should be warned against for performance reasons. Initializing a variable to it's default value is just extra work that accomplishes nothing. It might even make your script (infinitesimally) slower, whilst changing nothing.
Metadata
Metadata
Assignees
Labels
No labels