title: Powershell script triggers process only when invoked manually. Timing out when triggered via Scheduled Task
body: <p>On a Windows 2012 R2 server there is a Powershell script that I can manually invoke to start a process on some EXE, this works just fine.</p>
  
  <p>But when trying to trigger it via a scheduled task (invoking the same script) the <code>start-process</code> within the script just doesn't trigger or finish. Causing the task scheduler to terminate the task due to exceeding the timeout threshold.</p>
  
  <p>Here's the core section of the script: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$exe = "c:\some\app.exe"
  $arguments = "-user me -pwd secret"
  $process = Start-Process $exe -ArgumentList $arguments -PassThru -Wait
  return $process</code></pre>
  </div>
  </div>
  </p>
  
  <p>Is there some way I can get some insights into what <code>start-process</code> is doing or why the same script works when invoked manually but not programmatically?</p>
  
  <p>I want to emphasize that the way the script is invoked from the scheduled task is not a problem! The script triggers because the corresponding log file populates.</p>
  
  <p>Any insights or help on this is greatly appreciated!</p>