title: How to group Get-ChildItem -Recurse results in one output table?
body: <p>I'm using the following Powershell command:</p>
  
  <pre><code>Get-ChildItem -Recurse *.txt
  </code></pre>
  
  <p>But if there's multiple results the output will be like this:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>    Directory: C:\TestFolder\myfolder\
  
  Mode          LastWriteTime   Length Name
  ----          -------------   ------ ----
  -a---     d/m/yyyy hh:MM PM   1234   dragons.txt
  
      Directory: C:\TestFolder\anotherfolder\
  
  Mode          LastWriteTime   Length Name
  ----          -------------   ------ ----
  -a---     d/m/yyyy hh:MM PM   66550  jabberwocky.txt
  </code></pre>
  
  <p>But I <em>want</em> to get grouped results in some form.</p>
  
  <p>Maybe like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>Mode          LastWriteTime   Length Directory                     Name
  ----          -------------   ------ ---------                     ----
  -a---     d/m/yyyy hh:MM PM   1234   C:\TestFolder\myfolder\       dragons.txt
  -a---     d/m/yyyy hh:MM PM   66550  C:\TestFolder\anotherfolder\  jabberwocky.txt
  </code></pre>
  
  <p>Or this:</p>
  
  <pre class="lang-none prettyprint-override"><code>Length  FullPath
  ------  --------
  1234    C:\TestFolder\myfolder\dragons.txt
  66550   C:\TestFolder\anotherfolder\jabberwocky.txt
  </code></pre>
  
  <p>You probably get the idea. How can I accomplish this, preferably in a simple and elegant manner?</p>
  
  <p>I tried <code>Get-ChildItem -Recurse *.txt | Format-Table</code> but that doesn't do much. I've also checked the most relevant similar questions suggested by Stack Overflow (i.e. "<a href="https://stackoverflow.com/q/23976146/419956">Recurse with PowerShell's Get-ChildItem</a>", and others), but haven't been able to distill a solution so far.</p>
  
  <hr>
  
  <p><strong>Addendum</strong>:</p>
  
  <p>I used <code>help group</code> and found that <code>group</code> is actually the exact alias for the Cmdlet I thought I was looking for: <code>Group-Object</code>. If I do this:</p>
  
  <pre class="lang-none prettyprint-override"><code>Get-ChildItem -Recurse *.txt | Group-Object "FullName"
  </code></pre>
  
  <p>I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>Count   Name           Group
  -----   --------       -----
      1   C:\TestFold... {C:\TestFolder\myfolder\dragons.txt}
      1   C:\TestFold... {C:\TestFolder\anotherfolder\jabberwocky.txt}
  </code></pre>
  
  <p>But this requires me to simplify with <em>an additional step</em> to:</p>
  
  <pre class="lang-none prettyprint-override"><code>Get-ChildItem -Recurse *.txt | Group-Object "FullName" | Select-Object "Name"
  </code></pre>
  
  <p>Which gets:</p>
  
  <pre class="lang-none prettyprint-override"><code>Name
  ----
  C:\TestFolder\myfolder\dragons.txt
  C:\TestFolder\anotherfolder\jabberwocky.txt
  </code></pre>
  
  <p>If I <em>really</em> want extra properties, then I guess I want to "group on <em>multiple</em> properties", making the question effectively a duplicate of <a href="https://stackoverflow.com/q/30769809/419956">this other SO question</a>. </p>
  
  <p>However, all this "grouping" seems like overkill. Is there not a direct way of using <code>Get-ChildItem</code> to get the output I want?</p>