I use the below script to run two programs in parallel (line 3 and line 5; line 1 just makes the file open PowerShell, execute the commands and close it again). Unfortunately, the script pauses at line 3 and will not run the second program until I close the first one.
File start.cmd:
@PowerShell -ExecutionPolicy Bypass -Command Invoke-Expression $('$args=@(^&{$args} %*);'+[String]::Join(';',(Get-Content '%~f0') -notmatch '^^@PowerShell.*EOF$')) & goto :EOF
Set-Location -LiteralPath "D:\ngrok"
.\ngrok tcp --region=us --remote-addr=9.tcp.ngrok.io:22648 22
Set-Location -LiteralPath "C:\Users\apeal\OneDrive\Desktop\SSC"
Start-Process -FilePath "run.bat"
Here is a video of me running the code: https://youtu.be/1FBJTcBXWTM
As you can see, when I run the CMD file, the tcp portal connects, but only after I exit the console using (cmd + c), the portal closes and the server starts.
How can I run both programs with my script in parallel/asynchronous?