- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use the tree command in PowerShell?
Tree command graphically shows the folder structure of the given drive or a path. It is similar to Get−ChildItem or dir recursive command except this shows the graphical structure. For example, the below command will retrieve the folder structure of C:\VMs including
There are also two other switches supported for this command. They will appear in the help section of this command.
c:\>tree /? Graphically displays the folder structure of a drive or path. TREE [drive:][path] [/F] [/A] /F Display the names of the files in each folder. /A Use ASCII instead of extended characters.
This command is a cmd utility and hence we are using the ‘?’ symbol for the help command.
Command with /F switch which displays the name of the files in each folder.
tree c:\VMs /F
To display the one screen at a time, use the ‘more’ keyword in the pipeline. For example,
You can use /A switch uses text characters instead of graphical characters to show the line that links to subdirectories.
tree c:\VMs /a
- How to use the Timeout command in PowerShell?
- How to use the Set-Location command in PowerShell?
- How to use Split-Path command in PowerShell?
- How to use the ConvertFrom-StringData command in PowerShell?\n
- How to use PowerShell Break statement with the Switch command?
- How to use Push-Location and Pop-Location command in PowerShell?
- What is the use of Get-Process command in PowerShell?
- How to run PowerShell commands from the command prompt?
- How to get/resolve the command from the alias in PowerShell?
- How to run Invoke-Command in PowerShell Workflow?
- How to convert command output to the Hashtable format in PowerShell?
- How to run a PowerShell script from the command prompt?
- How to change the Title of the console using PowerShell command?
- How to pass arguments in Invoke-Command in PowerShell?
- PowerShell: Wait for the First command to finish