title: Array.Find on powershell array
body: <p>How can I use the <a href="http://msdn.microsoft.com/en-us/library/d9hy2xwa%28v=vs.110%29.aspx">Array.Find</a> method in powershell?</p>
  
  <p>For example:</p>
  
  <pre><code>$a = 1,2,3,4,5
  [Array]::Find($a, { args[0] -eq 3 })
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>Cannot find an overload for "Find" and the argument count: "2".
  At line:3 char:1
  + [Array]::Find($a, { $args[0] -eq 3 })
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodException
      + FullyQualifiedErrorId : MethodCountCouldNotFindBest
  </code></pre>
  
  <p>The array class has the methods I expect, as given by:</p>
  
  <pre><code>PS&gt; [Array] | Get-Member -Static
  
     TypeName: System.Array
  
  Name            MemberType Definition                                                                                       
  ----            ---------- ----------
  Find            Method     static T Find[T](T[] array, System.Predicate[T] match)
  </code></pre>
  
  <p>Should the array be casted to something else to match the T[] type? I know there are other ways to achieve the find functionality, but I was wondering why this doesn't work.</p>