DEV Community

redhcp
redhcp

Posted on

List Numbers Files by Dir in Select Path - Powershell

This script list numbers files by dir in select path

$folders = get-ChildItem -Directory -Path "C:\YOUR_PATH"
$folders |
ForEach-Object { 
        $path = $_.FullName
    [pscustomobject]@{
        Path = $path
        FileCount = (Get-ChildItem -Path $path -Recurse -File).Count 
    }
}
Enter fullscreen mode Exit fullscreen mode

Thanks for read!

Top comments (0)