Powershell While Loop Array Javascript Methods And Functions