【调试记录】: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"
}
相关推荐
java之迷4 小时前
Windows环境下,源码启动+本地部署和启动开源项目Ragflow失败SRE模块
windows·docker·开源
摩羯座-185690305947 小时前
爬坑 10 年!京东店铺全量商品接口实战开发:从分页优化、SKU 关联到数据完整性闭环
linux·网络·数据库·windows·爬虫·python
zym大哥大13 小时前
高并发内存池
服务器·数据库·windows
铁手飞鹰16 小时前
VS2022创建项目工程笔记
c++·windows·笔记·visualstudio
私人珍藏库17 小时前
笔墨星河 - AI长篇小说生成软件
windows·ai·工具
charlie11451419117 小时前
Windows 10 系统编程——线程专题1
c++·windows·学习·线程
TeleostNaCl19 小时前
如何在 Windows 上使用命令设置网卡的静态 IP 地址
网络·windows·经验分享·网络协议·tcp/ip·ip
做运维的阿瑞19 小时前
PostgreSQL 从入门到精通:Windows 环境下安装与使用指南
数据库·windows·postgresql
持梦远方21 小时前
鼠标消息超时处理——实现图形界面自动操作,避免鼠标消息阻塞
c++·windows·microsoft·bug处理
tryCbest1 天前
Windows和Linux设置Https(SSL)访问
linux·windows·https