Get all child folders with PowerShell




The commandlet 'Get-ChildItem' will give you all the default information about the folders inside. By default they are: Mode, LastWriteTime, Length (for files) and Name.

Get-ChildItem c:\Path

If you want to achieve only the names, you should use the command like this:

Get-ChildItem -Directory | Select-Object Name

To store the data to a file, use something like this:

Get-ChildItem -Directory | Select-Object Name > result.txt




No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment





MarkiMarta.com. Notes of web-specialist
Since 2009
18+