Powershell Tip #81: Count files and folders By powershellgu | November 30, 2015 0 Comment Tip: You can count the files and folders : PowerShell # Count Files ((Get-ChildItem -Path 'C:\demo' -Recurse -File | Measure-Object)).Count # Count Folders ((Get-ChildItem -Path 'C:\demo' -Recurse -Directory | Measure-Object)).Count 12345 # Count Files((Get-ChildItem -Path 'C:\demo' -Recurse -File | Measure-Object)).Count # Count Folders((Get-ChildItem -Path 'C:\demo' -Recurse -Directory | Measure-Object)).Count Note: The parameters -File and -Directory require PowerShell v3.