Avoid +=
+= is very slow, it rebuilds the array every time. This is applicable to both arrays, and to string concatenation.
Not sure if it would be worth it to try and only flag this inside of a loop, or if we want to have different severity levels for this based on whether it is in a loop.
Reference for rule recommendation: https://powershell.one/tricks/performance/arrays
Avoid +=
+= is very slow, it rebuilds the array every time. This is applicable to both arrays, and to string concatenation.
Not sure if it would be worth it to try and only flag this inside of a loop, or if we want to have different severity levels for this based on whether it is in a loop.
Reference for rule recommendation: https://powershell.one/tricks/performance/arrays