title: Excel Crashes when trying to run powershell command
body: <p>I am having an issue trying to run a complex HTTP Request through a powershell command from a VBA function.</p>
  <p>VBA Code Below: The powershell script runs fine from inside powershell</p>
  <pre><code>Public Function PS_GetOutput(id As String) As String
      'Setup the powershell command properly
      psCommand = &quot;powershell -command &quot; &amp; &quot;C:\Users\promney\temp1\curlCommand.ps1 &quot; &amp; id
      'Execute the command
      CreateObject(&quot;WScript.Shell&quot;).Run psCommand, 3, True
      'Get an instance of the clipboard to capture the save value
  End Function
  
  </code></pre>
  <p>The PS1 file should grab the html and put a string on the clipboard. Instead, the PS window opens as a blue field, then it and excel crash completely and immediately. What am I doing wrong here?</p>
  <p>Note: I would include the PS script but that is a lot of possibly sensitive info to scrub and I'm pretty sure the issue is in the VBA, since it works fine unless called from excel.</p>