【调试记录】:windows查看一个文件夹下(多个子文件夹)每个子文件夹中文件的数量分别是多少

查看文件夹小所有文件的数量,包括子文件中的文件的数量

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"
}
相关推荐
斜月三5 小时前
windows部署多实例filebeat监控相同路径下文件
windows·filebeat
尽兴-9 小时前
如何将多个.sql文件合并成一个:Windows和Linux/Mac详细指南
linux·数据库·windows·sql·macos
chilavert31812 小时前
技术演进中的开发沉思-30 MFC系列:五大机制
c++·windows
荔枝吻1 天前
【保姆级喂饭教程】Windows下安装Git Flow
windows·git·git flow
深盾科技1 天前
深入解析 .NET 泛型:从原理到实战优化
windows·.net
石头wang1 天前
如何在idea里快速地切换Windows CMD、git bash、powershell
windows·git·bash·intellij-idea
天高云淡ylz2 天前
各类电子设备镜像格式及文件系统统计
linux·windows·risc-v
LCG元2 天前
Windows实时内核驱动的数据捕获接口:高精度时钟与零拷贝的架构剖析
windows·架构
行者游学2 天前
windows grpcurl
windows
goxingman2 天前
Spring Data JPA基本方法调用规律
windows