Javascript Foreach Loop Through Array Powershell Update