title: Passing a variable to a powershell script via command line
body: <p>I am new to powershell, and trying to teach myself the basics.  I need to write a ps script to parse a file, which has not been too difficult.</p>
  
  <p>Now I want to change it to pass a variable to the script.  that variable will be the parsing string.  Now, the variable will always be 1 word, and not a set of words or multiple words.</p>
  
  <p>This seems uber simple yet is posing a problem for me.  Here is my simple code:</p>
  
  <pre><code>$a = Read-Host
  Write-Host $a
  </code></pre>
  
  <p>When I run the script from my command line the variable passing doesn't work:</p>
  
  <pre><code>.\test.ps1 hello
  .\test.ps1 "hello"
  .\test.ps1 -a "hello"
  .\test.ps1 -a hello
  .\test.ps1 -File "hello"
  </code></pre>
  
  <p>As you can see, I have tried many methos with no success, of the script taking the value an outputting it.</p>
  
  <p>The script does run, and waits for me to type a value, and when I do, it echos that value.</p>
  
  <p>I just want it to output my passed in value, what minuscule thing am I missing?</p>
  
  <p>Thank you.</p>