0

How can I start a non-blocking shell command in PowerShell? I can use Start-Process to start an executable but I have to split my parameters and it requires a full path instead of using the PATH variable.

I want to run something like:

Start-Process "npm run serve:dev"

instead of

Start-Process 'C:\\path\\to\\npm.exe' -ArgumentList "run", "serve:dev"

Invoke-Expression accepts a single string but that's not non-blocking.

sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • 1
    Use PowerShell Jobs? If I catch your intention. – Matt Sep 07 '18 at 14:13
  • @Duncan That question doesn't work for me, because it recommends `Start-Process` which doesn't accept a single string. My question asks how to do it without using Start-Process. – sashoalm Sep 07 '18 at 14:16
  • @sashoalm read that question more carefully. The OP edited it to include a solution that takes a single string. – Duncan Sep 07 '18 at 14:22

0 Answers0