title: Kill process by ParentProcessID
body: <p>I want to kill a running process by its ParentProcessID. I want to do it like you can do it in the commandline:</p>
  
  <pre><code>wmic process where parentprocessid= 3008 terminate 
  </code></pre>
  
  <p>But now the thing is, in PowerShell I've the ParentProcessID as a variable like this:</p>
  
  <pre><code>$p = 3008
  </code></pre>
  
  <p>And now I would like to kill the process by the varibale <code>$p</code> but this doesn't work:</p>
  
  <pre><code>wmic process where parentprocessid= $p terminate
  </code></pre>
  
  <p>How can I kill a process by its ParentProcessID, if I have the ParentProcessID stored in a variable?</p>