When you copy variable content, you may just copy the "reference" (memory address), not the content. Take a look at this example:
$a = 1..10 $b = $a $b = 'changed' $b $a
Although you changed $b, there was a change in $a as well. Both variables reference the same memory location, so both have identical content.
To create a completely new copy of an array, you need to clone it first:
$a = 1..10 $b = $a.Clone() $b = 'changed' $b $a