title: Get index of object in Generic/List based on value of a property
body: <p>I can populate a <code>Generic.List</code> with instances of my class, each with a unique value in the ID property, like this.</p>
  
  <pre><code>$packages = [System.Collections.Generic.List[object]]::New()
  
  class Package {
      # Properties
      [String]$ID
  
      # Constructor
      Package ([String]$id) {
          $this.ID = $id
      }
  }
  
  foreach ($i in 65..90) {
      $packages.Add([Package]::New("$([char]$i)"))
  }
  </code></pre>
  
  <p>Now I want to get the index of a particular item, along the lines of <code>$packages.IndexOf('C')</code>. But doing this in C# seems to require the use of a lambda, and PowerShell doesn't seem to support that. I would rather not have to initialize my own index variable and iterate through all the items in the list checking their IDs and incrementing the index along the way. But, maybe this is that grey area between using PowerShell with only native PS cmdlets and just using C#, where you miss out on the sugar in both extremes and have to make your own?</p>