Powershell While Loop Syntax In Javascript Regular