查看文件夹小所有文件的数量,包括子文件中的文件的数量
Get-ChildItem -Path "C:\path\to\your\directory" -Recurse | Measure-Object
查看一个文件夹下多个子文件每个子文件夹中文件的数量分别是多少
$targetFolder = "C:\path\to\your\directory" # 替换为你的目标文件夹路径$subFolders = Get-ChildItem -Path $targetFolder -Directory -Recurseforeach ($folder in $subFolders) {$folderPath = $folder.FullName$fileCount = (Get-ChildItem -Path $folderPath -File -Recurse | Measure-Object).CountWrite-Host "Number of files in $folderPath: $fileCount"
}