Powershell Custom Object Array Iterator Javascript Function