title: How to run PowerShell script in a different process and pass arguments to it?
body: <p>Let's say I have a script:</p>
  
  <pre><code>write-host "Message.Status: Test Message Status";
  </code></pre>
  
  <p>I managed to run it in a separate process by doing:</p>
  
  <pre><code>powershell.exe -Command
  { write-host "Message.Status: Test Message Status"; }  
  </code></pre>
  
  <p>The problem is I want to pass parameters to the script so that I can achieve something like this:</p>
  
  <pre><code>write-host "I am in main process"
  powershell.exe -Command -ArgumentList "I","am","here"
  {
      write-host "I am in another process"
      write-host "Message.Status: $($one) $($two) $($three)";
  }
  </code></pre>
  
  <p>However <code>-ArgumentList</code> doesn't work here</p>
  
  <p>I get:</p>
  
  <pre><code>powershell.exe : -ArgumentList : The term '-ArgumentList' is not recognized as the name of a cmdlet, function, script file, or operable 
  </code></pre>
  
  <p>I need to run some part of PowerShell script file in a different process and I cannot use another file due to the fact that PowerShell script is uploaded to external system.</p>