Powershell While Loop Syntax In Javascript