title: Group Objects within already grouped objects
body: <p>I'm trying to prepare a list of files with duplicate names but different extensions. At the same time I'd like to exclude files with the same extension. So far I've created this</p>
  <pre><code>gci -path &quot;PATH&quot; -recurse -file -erroraction silentlycontinue|
  Select @{l='Original Filename';e={$_.PSChildName}},  @{l='Compare Filename';e={$_.BaseName.replace('_','*').replace(' ','*').replace('-','*')}}, @{l=&quot;Path&quot;;e={$_.PSParentPath.Substring(38,$_.PSParentPath.Length-38)}}, @{l=&quot;Link&quot;;e={$_.FullName}}, @{l=&quot;Extension&quot;;e={$_.Extension}}
  group -Property 'Compare Filename'|
  Where {$_.count -ge 2}|
  %{$_.group}|
  Export-Csv -Path &quot;PATH&quot; -NoTypeInformation
  </code></pre>
  <p>I figured I'd need to group objects within already grouped objects by 'extension' property and discard those groups where 'extension groups' count is less than 2.</p>
  <p>Exmaple</p>
  <pre><code>Include
  Name Ext
  asd  .pdf
  asd  .ppt
  
  
  Exclude
  asd  .pdf
  asd  .pdf
  </code></pre>
  <p>Any ideas?</p>