title: Why won't this powershell script accept parameters?
body: <h2>myscript.ps1</h2>
  
  <pre><code>Param(
      [Parameter(Mandatory=$true,Position=1)]
      [string]$computerName
  )
  
  echo "arg0: " $computerName
  </code></pre>
  
  <h2>CMD.exe</h2>
  
  <pre><code>C:\&gt; myscript.ps1 -computerName hey
  </code></pre>
  
  <p>Output:</p>
  
  <pre>
      cmdlet myscript.ps1 at command pipeline position 1
      Supply values for the following parameters:
      computerName: ddd
      arg0:
      ddd
  </pre>
  
  <p>I'm simply trying to work with Powershell parameters in CMD, and I can't seem to get a script to take one. I see sites saying to precede the script with <code>.\</code> but that doesn't help. I added the mandatory line to see if Powershell was reading a parameter or not, and it's clearly not. The parameter <code>computerName</code> is obviously the word "hey". The <code>Param</code> block is the very first thing in the script. Powershell appears to recognize a parameter <code>computerName</code>, but no matter how I enter the command, it never thinks I'm actually entering parameter.</p>
  
  <p>What the heck's wrong with my syntax?</p>