Closed
Description
I have some code that is being flagged for the rule PSUseDeclaredVarsMoreThenAssignements.
SUseDeclaredVarsMoreThanAssignment Warning MSFT_xWebA 876 The variable 'newParts' is assigned but never used.
s ppPool.psm
1
Context can be found here
Code in question:
$newParts = @()
1..($parts.Count -1) | ForEach-Object {
$newParts += $parts[$_]
}
$newName = ($newParts -join '.')
As we can see the variable is used in a few places shortly after its creation. I am running version 1.9.0 downloaded from the gallery.