Forrest logo
back to the Get-ChildItem tool

get-childitem:tldr:2e23b

get-childitem: List only directories in the current directory.
$ Get-ChildItem -Directory
try on your machine

The command "Get-ChildItem -Directory" is a PowerShell command that retrieves a list of all directories or folders within the current directory.

Here is a breakdown of the command:

  • "Get-ChildItem" is a cmdlet (command-let) in PowerShell used to retrieve files and directories. It is similar to the "dir" command in Windows Command Prompt.
  • "-Directory" is a parameter that is used with the "Get-ChildItem" cmdlet to filter the results to only include directories.

When the command is executed, it will return a list of all the directories present in the current directory. The output will include the name, size, and other relevant properties of each directory.

For example, if you run this command in the "C:\Users" directory, it will return a list of all directories within "C:\Users", such as "Documents", "Downloads", "Pictures", etc.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the Get-ChildItem tool