Track PID of process I just started in PowerShell
<pre><code>casperjs CMQ_scraper.js
Stop-Process -name phantomjs
</code></pre>

<p>I want to start a process (casperjs CMQ_scraper.js) and then immediately kill it.</p>

<p>CMQ_scraper.js shows up as phantomjs.exe in command line. however, I may have other phantomjs instances running that I don't want to kill. How can I save the PID of the new process so that I can later kill it?</p>