title: How to Correctly Check if a Process is running and Stop it
body: <p>What is the correct way of determining if a process is running, for example FireFox, and stopping it?</p>
  
  <p>I did some looking around and the best way I found was this:</p>
  
  <pre><code>if((get-process "firefox" -ea SilentlyContinue) -eq $Null){ 
          echo "Not Running" 
  }
  
  else{ 
      echo "Running"
      Stop-Process -processname "firefox"
   }
  </code></pre>
  
  <p>Is this the ideal way of doing it? If not, what the correct way of doing so?</p>