title: Powershell script doesn't wait on a process to finish
body: <p>I have this powershell script that performs set of instructions one of which is <code>Start-Process</code> an executable. Howerver I do not want any subsequent instruction to be executed until absolutely the exe is finished. So I used  </p>
  
  <pre><code>Start-Process progname.exe -wait
  </code></pre>
  
  <p>The problem is sometimes it works and sometimes it doesn't. How can I ensure no subsequent commands are executed until the exe file completes.</p>