Windows 10 Powershell tree command, how to show files

20

How do I list folders and files using the PowerShell tree command? Is it possible to color format the output for distinct files and folders?

Tuomas Toivonen

Posted 2017-11-20T09:08:27.197

Reputation: 363

1See tree /?. "/F Display the names of the files in each folder." As for colors, superuser isn't a script writing service. If you're stuck with a specific problem and post your code, people here would love to help you. – root – 2017-11-20T14:23:37.987

Answers

18

Simply use tree /F on any powershell instance to have the same behavior the normal tree on UNIX has.

The tree alone on Powershell shows only folders but not files in them.

Juansero29

Posted 2017-11-20T09:08:27.197

Reputation: 196

0

TREE Drive:\path /F

If command prompt or power shell are not recognizing 'tree', then:

Go to environment variables and change both the user variables and system variables "Path" to C:\Windows\System32 (Mine is C:\Windows\System32 ,Find yours using %systemroot%\System32)

Then open new power shell and give the above command. EX: enter image description here

Swati Vavilapalli

Posted 2017-11-20T09:08:27.197

Reputation: 1