Javascript Function Loop Through Array Powershell Commands