Is there any way that I can get all the folders and files count inside a folder?

Highlighted
Frequent Contributor

Is there a way to get the count of all the files, folders under a particular folder using PowerShell command? 

1 Reply
Highlighted

Yes, simply use the -Recurse parameter? For example:

 

(dir D:\Downloads\ -Recurse).Count

dir . -Recurse | measure