Use Variable In Powershell String Length Javascript Method Splice