This code merely is supposed to set $null value in Status property of two objects: $Object1 and $Object2. While of course you usually wouldn't use While for such case, but in my code I did. When you run the code above you will get $true as an output of $Test1 variable. Everything according to plan, but with one problem – $Array.Status comparison complaining that I'm using $null on the wrong side. Let's fix it. For comparison purposes, I left both loops in the code.