Javascript Function Loop Through Array Powershell Update File