Copy and then paste the following into Windows PowerShell ISE, and then save it as a PowerShell script (`.ps1`) file. $listBox.Location = New-Object System.Drawing ...
Please use fenced code blocks to properly format your code and provide complete environment information. I get the following when I run your code, both in Windows PowerShell as well as in PowerShell 7 ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results