title: Positional parameter cannot be found
body: <p>I'm not sure why I'm getting the following error</p>
  
  <p><code>Copy-Item : A positional parameter cannot be found that accepts argument 'C:\Code\PS\Auths\2.jpg'.
  At C:\Code\PS\auth-grab.ps1:9 char:12</code></p>
  
  <p><strong>C:\Code\PS\Auths\2.jpg is the correct path.</strong></p>
  
  <p>(I'm getting one of these for each of the items in the pipeline)</p>
  
  <p>When I echo $rv I get the correct pathand $_ should be right. Where am I going wrong?</p>
  
  <p>oops script below :</p>
  
  <pre><code>function Generate-FileName($fi)
  {           
      $rv = "C:\Code\PS\New\"+ $fi.Name
      #echo rv    
  }
  
  Get-ChildItem Auths\*.* -include 1.jpg, 2.jpg | 
  ForEach-Object {        
      Copy-Item $_ -destination Generate-FileName(Get-ChildItem $_)       
  }
  </code></pre>
  
  <p>Note if i echo $rv I get the path I want</p>