title: Powershell argument passing to function seemingly not working
body: <p>I sense that I am doing something silly, but here is the issue:</p>
  
  <pre><code>Function getPropertyOfFile($a, $b, $c)
  {
      $a.GetDetailsOf($b, $c)
  }
  </code></pre>
  
  <p>If I pass $a, $b, $c variables that are appropriate to the function, it fails saying that </p>
  
  <blockquote>
    <p>"Method invocation failed because [System.Object[]] doesn't contain a method named 'GetDetailsOf'."</p>
  </blockquote>
  
  <p>However, if I directly replace $a, $b, $c with the arguments that I was passing, and then try to run that, it works fine.</p>
  
  <p>What the heck is going on?</p>
  
  <p><strong>Note:</strong> I am using powershell ISE, and am inputting the function to powershell by copy/pasting it into the console. I have also been working under the assumption that if I input a new function with the same name, it would overwrite. Is there a better way to just have PS read from the .ps1?</p>
  
  <p><strong>Edit:</strong> I am trying to wrap the answer to <a href="https://stackoverflow.com/questions/9420055/enumerate-file-properties-in-powershell/9420165#9420165">this question</a> into functions.</p>
  
  <p><strong>Edit 2:</strong></p>
  
  <pre><code>Function getPropertyOfFile $a $b $c
  {
      $a.GetDetailsOf($b, $c)
  }
  </code></pre>
  
  <p>Gives an <code>Missing function body in function declaration.
  At line:1 char:28</code> error.</p>