I used the above answer with a few changes to run a task where I wanted to open cmd and after run a command, in my case, I wanted to run iex -S mix phx.server
to run my Phoenix app inside IEx (Interactive Elixir).
So here's what I did, in the tasks.json:
{
"label": "task name",
"type": "shell",
"command": "Start-Process",
"args": [
"-FilePath",
"C:/WINDOWS/System32/cmd.exe",
"-ArgumentList",
"/K iex -S mix phx.server"
],
"options": {
"cwd": "${workspaceRoot}",
"requireFiles": [],
},
"presentation": {
"reveal": "never"
},
},
I just put in the command
property the "Start-Process" and all the remaining things I added as args
. The command you want to execute after opening the external terminal must go into the -ArgumentList
parameter