title: powershell script reading parameters from txt
body: <p>I have a script that takes 2 parameters (name and location).  I put the name and location into a txt file as per this post here <a href="https://stackoverflow.com/questions/28088460/powershell-parameters-from-file">Powershell parameters from file</a>.  I got prompted to put in value for the 2nd parameter:</p>
  
  
  
  <pre class="lang-psh prettyprint-override"><code>Import-Csv 'C:\temp\paramtest.txt' | % { C:\temp\script\paramtest.ps1 @_ }
  </code></pre>
  
  <blockquote>
    <p>cmdlet paramtest.ps1 at command pipeline position 1 Supply values for
    the following parameters: param2:**</p>
  </blockquote>
  
  <p>This is what my .txt look like:</p>
  
  <pre class="lang-psh prettyprint-override"><code>"param","param2"
  "foo","c:\temp"
  "bar","c:\temp"
  "foobar","c:\temp"
  </code></pre>
  
  <p>and the Powershell script is just plain:</p>
  
  <pre class="lang-psh prettyprint-override"><code>Param (
      [Parameter(mandatory=$true,Position=1)]
      [string]$param, 
      [Parameter(mandatory=$true,Position=2)]
      [string]$param2
      ) 
  
  $greeting='Hello to ' + $param + ' and ' + $param2
  Write-Output $greeting
  </code></pre>
  
  <p>Any help is appreciated.</p>