Powershell Replace Text In String Javascript Substring Vs Slice