Powershell Custom Object Array Iterator Javascript Substring Function