Javascript Function Loop Through Array Powershell Execution Log