title: Query a list LINQ-style in PowerShell
body: <pre><code>add-type -Language CSharpVersion3 -TypeDefinition @"
      public class pack_code
      {
          public pack_code() {}
  
          public string code { get; set; }
          public string type { get; set; }
      }
  "@
  
  $a = New-Object pack_code
  $a.code = "3"
  $a.type = "5"
  $b = New-Object pack_code
  $b.code = "2"
  $b.type = "5"
  $c = New-Object pack_code
  $c.code = "2"
  $c.type = "5"
  $d = New-Object pack_code
  $d.code = "1"
  $d.type = "1"
  
  $codes = New-Object 'System.Collections.Generic.List[object]'
  $codes.add($a)
  $codes.add($b)
  $codes.add($c)
  $codes.add($d)
  </code></pre>
  
  <p>Is there a way to select distinct from $codes and select the objects where type equals 1? How can I use LINQ with PowerShell?</p>