title: Passing Named Parameters via an intermediary script
body: <p>I have two scripts:</p>
  
  <p>Script1.ps1:</p>
  
  <pre><code>param(
  [string]$WhoCares = "",
  [string]$PassThrough = ""
  )
  
  #do a whole bunch of random stuff here...
  .\Script2.ps1 $PassThrough
  </code></pre>
  
  <p>Script2.ps1:</p>
  
  <pre><code>param(
  [string]$FirstParameter = "",
  [string]$SecondParameter = ""
  )
  
  Write-Host "First Parameter is: " $FirstParameter "Second Parmeter is: " $SecondParameter
  </code></pre>
  
  <p>What I envision doing is something like:</p>
  
  <p>Script1.ps1 -WhoCares one -Passthrough "-FirstParameter Test -SecondParameter Test1"</p>
  
  <p>And then seeing:</p>
  
  <p>First Paramter is Test Second Parameter is Test1</p>
  
  <p>But What I am seeing is</p>
  
  <p>First Parameter is -FirstParameter Test -SecondParameter Test1 Second Parameter is</p>
  
  <p>which is, parameters I want to send to script2 are coming through as a string.  How to I pass parameters through an intermediary script</p>
  
  <p>I don't want to modify Script1.ps1 to include every possible parameter, because im using Script1 to setup an environment, logging, etc.</p>