title: Select-Object doesn't return object?
body: <p>The following code returns expected list.</p>
  
  <pre><code>$groups = ps | group Name
  
  $groups | Sort-Object Name | % { 
      $g = $_.Group | measure PM -Sum;
      New-Object psobject -Property @{ Name2 = $_.Name; Count = $g.Count; Sum = $g.Sum }
  }
  </code></pre>
  
  <p>However, the following script, which use <code>select</code> to create custom object, returns nothing? I read that <code>Select-object</code> is another way to create <code>PSObject</code>?</p>
  
  <pre><code>$groups = ps | group Name
  
  $groups | Sort-Object Name | % { 
      $g = $_.Group | measure PM -Sum;
      select -Property @{ Name = 'Name'; expression = { $_.Name }},
                       @{ Name = 'Count'; expression = { $g.Count }},
                       @{ Name = 'Sum'; expression = { $g.Sum }}
  }
  </code></pre>
  
  <p><strong>Update:</strong>
  Tested it on Powershell 2.0 and 3.0. They behave the same. </p>
  
  <pre>
  Windows PowerShell
  Copyright (C) 2012 Microsoft Corporation. All rights reserved.
  
  PS H:\> $groups = ps | group Name
  PS H:\>
  PS H:\> $groups | Sort-Object Name | % {
  >>     $g = $_.Group | measure PM -Sum;
  >>     # New-Object psobject -Property @{ Name2 = $_.Name; Count = $g.Count; Sum = $g.Sum }
  >>     select -Property @{ Name = 'Name'; expression = { $_.Name }}, @{ Name = 'Count'; expression = { $g.Count }}, @{ Name = 'Sum'; expression = { $g.Sum }}
  >> }
  >>
  PS H:\>
  </pre>