title: Passing Params from PHP to Powershell exec
body: <p>I am attempting to write a <em>PHP script</em> that will allow for me to select a few files to download from a predetermined location. I'd like my script to pass an array to a <em>Powershell script</em> that id written earlier and have my <em>Powershell script</em> handle the downloading (basically the php file just needs to tell the <em>powershell</em> file what needs to be downloaded).
  I've looked at a few options, and it seems that <code>exec</code> is the command I should use for this (as I do not care about command line output I shouldnt need <code>shell_exec</code>).</p>
  
  <p>So far I've turned <code>OFF</code> safe mode to allow me to use this command. I should also note that the <em>php</em> file will be run from a server, however the <em>powershell</em> files are located on a local machine.</p>
  
  <p>A snippet of the code so far to handle the param passing looks like this:</p>
  
  <pre><code>if(isset($_POST['formSubmit'])) 
  {
      $choosePlugin = $_POST['wpPlugin'];
      $chooseTheme = $_POST['wpTheme'];
  
      if(isset($_POST['wpTheme'])) 
      {
          echo("&lt;p&gt;You selected: $chooseTheme&lt;/p&gt;\n");
          exec('powershell.exe C:\Wordpress Setup\setupThemes.ps1 $chooseTheme');
  
      } 
      else 
      {
          echo("&lt;p&gt;You did not select a theme&lt;/p&gt;\n");
      }
  </code></pre>
  
  <p>I am a bit confused as to what I should put inside the <code>exec</code>.  When I run the above code there are no errors however nothing happens. I am a bit new to this so I apologize if more information is required. Any help is appreciated thank you.</p>