Reputation: 9229
I want to write a powershell script that sets up a development environment. Firstly, I want to launch two command prompts which are running yarn run dev:client
and yarn run dev:server
respectively.
I have tried start cmd
and Start-Process cmd -Argument yarn,run,dev:server
, but am unable to get the newly launched command prompt to run the command.
How do I do this?
Upvotes: 2
Views: 9178
Reputation: 969
The generic way is:
cmd /c "insert_your_command_here"
This means in your case you would execute:
cmd /c "yarn run dev:client"
cmd /c "yarn run dev:server"
Upvotes: 1
Reputation: 387
What about:
$arg="run dev:server"
Start-Process -FilePath path_to_yarn -Args $arg -passthru -RedirectStandardError err.log
Upvotes: 0