You can use PowerShell cmdlet Get-ChildItem to get only the directory’s names. Here is a quick example for you –
1 |
Get-ChildItem -Recurse -Path "C:\Windows" | ?{ $_.PSIsContainer } | Select-Object FullName -First 10 |
This will get the first 10 directory names under C:\Windows directory