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