title: Return the second level directory names only
body: <p>I would like to retrieve all (and only) second level directory names of my disk. For example, <code>C:\folder1\folder2</code> and <code>C:\folder1\folder3</code>, I need to retrieve only <code>folder2</code> and <code>folder3</code>.</p>
  
  <p>I write this and the PS displays all the directory names:</p>
  
  <pre><code>Get-ChildItem -Recurse | ?{ $_.PSIsContainer} | Select-Object Name
  </code></pre>
  
  <p>I found this <a href="https://superuser.com/questions/825874/using-get-childitem-but-only-look-at-the-2nd-level-down">help</a>, and I modify the previous command in this way:</p>
  
  <pre><code> Get-ChildItem -Recurse |  `Where-Object {($_.directory -match '^*\\\S*$')} ` | ForEach-Object {?{ $_.PSIsContainer} | Select-Object Name }
  </code></pre>
  
  <p>but when I use it the PS doesn't display anything.</p>
  
  <p>I can't understand why, someone can help me? Thank you!</p>