title: Argument list and the pipeline
body: <p>as an adjunct to this issue: <a href="https://stackoverflow.com/questions/18861701/how-do-i-force-declared-parameters-to-require-explicit-naming">How do I force declared parameters to require explicit naming?</a> I am struggling with pipelines.  Suppose I want the behaviour that this declares:</p>
  
  <pre><code>param(
     $installdir, 
     $compilemode, 
     [Parameter(Position=0, ValueFromRemainingArguments=$true)] $files
     )
  </code></pre>
  
  <p>namely, that I can call my script like this:</p>
  
  <pre><code>c:\&gt; MyScript -installdir c:\ file-1.txt file-2.txt file-3.txt
  </code></pre>
  
  <p>but now I want to also be able to do it this way:</p>
  
  <pre><code>c:\&gt; gi file-*.txt |MyScript -installdir c:\
  </code></pre>
  
  <p>I might think of adding a decoration to the parameter like this:</p>
  
  <pre><code>param(
     $installdir, 
     $compilemode, 
     [Parameter(
         Position=0, 
         ValueFromRemainingArguments=$true, 
         ValueFromPipeline=$true
     )] $files
     )
  </code></pre>
  
  <p>but what actually happens is I only get 1 argument into my parameter i.e. instead of getting an array with all the files that <code>gi</code> produced, I get only the first in the list.</p>
  
  <p>A second way I attempted this was by using the <code>$input</code> variable (instead of using the <code>ValueFromPipeline</code> decorator), but then in trying to call the script I get the error: </p>
  
  <blockquote>
    <p>The input object cannot be bound to any parameters for the command 
    either because the command does not take pipeline input or the input
    and its properties do not match any of the parameters that take
    pipeline  input.</p>
  </blockquote>
  
  <p>where can I go from here?</p>