Powershell Split File Based On Regex Capture Javascript For Loop