【调试记录】: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"
}
相关推荐
Thneonl17 小时前
桌宠穿透不是一行 SetWindowLong
windows·程序员
艺杯羹1 天前
Windows原生软件锁设计:从暴力杀进程丢数据到零轮询事件驱动架构
windows·系统架构·开源·开源软件·内存管理·开源协议
csdn_aspnet2 天前
Redis 入门:Windows、Mac安装指南
数据库·windows·redis·缓存·mac
没差c3 天前
winsw将jar、nginx等注册为Windows服务
windows·nginx·jar
光谱SpectrAI3 天前
Claude Code 2.1.318 的隐私模块:4 条命令,拦了 2 条
windows
Hello_Pyhx3 天前
NWinfo 导出 Windows 硬件信息:从 JSON 报告到缺项排查
windows·json
百事牛科技4 天前
Excel的三种密码:防看、防存、防乱改,各管各的
windows·excel
the3clipse5 天前
MPC-HC 下载安装与最佳配置教程:免费开源、轻量无广告、支持 4K 硬解的 Windows 播放器
windows·播放器·安装教程·硬件加速·mpc-hc·字幕设置·lav filters
独隅5 天前
WebStorm Windows 版 React / Next.js 实战替换指南
javascript·windows·webstorm
陈工大模型5 天前
2026年11月最新免费解压软件横评:7-Zip 、 Win解压缩名列前茅
windows·软件工程·7-zip·压缩软件