Powershell While Loop Array Javascript Methods For Objects