title: Processes in Powershell
body: <p><br/>
  I have got a problem.<br/>
  1.The first situation <br/>
  <strong>Process has already started.</strong><br/>
  And I want to do something after the current process is completed.<br/>
  For example <br/> 
  <code>$process=[System.Diagnostics.Process]::GetProcessesByName("notepad")</code> <br/>
  And <br/>
  <code>Register-ObjectEvent $process Exited -Action {}</code><br/> 
  But in this case, it's not working <br/>
  How Can I Register Event "Exited"?<br/>
  2. The Second situation<br/>
  <strong>The Process has not yet been started.</strong>
  How I can to wait for start process?)</p>