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

Frequent Contributor

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

1 Reply

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

 

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

dir . -Recurse | measure