title: Running powershell script through the system command - output creates a file that is empty
body: <p>I am attempting to run a powershell script through the system command.
  This is the code I am using</p>
  <pre><code> status = system(&quot;start powershell.exe Set-ExecutionPolicy RemoteSigned \n&quot;);
   status = system(&quot;start powershell.exe D:\\foo\\tempFilePShellCommand.ps1 &gt; D:\\foo\\MyFile.txt&quot;);
  </code></pre>
  <p>Now the problem with the above code is that MyFile.txt gets created but its empty.
  If I run the file through powershell the file gets created and contains the correct data.
  Any suggestions on why the file is empty and how I can fix this /</p>