【调试记录】: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"
}
相关推荐
Uncertainty!!17 小时前
Windows 10 与 Ubuntu 22.04 通过 Samba 共享文件夹
windows·ubuntu·共享文件夹
百事牛科技19 小时前
如何创建7Z压缩包?Windows下7-Zip操作方法
windows·7-zip
池央20 小时前
Windows本地部署Qwen3.8实战:LM Studio、Cherry Studio、远程API与Token鉴权
windows
泡海椒1 天前
JQuick-SQL 快速开始:注册内存表并执行查询
数据库·windows·sql
钱栈up1 天前
耳机音效不对,我顺手查了系统更新,结果挖出个崩溃了整天的服务
windows·shell
xiao77mwq1 天前
Wireshark 在 Windows 上没法按进程抓包,我补了一条路
windows
Helix2501 天前
MDT自动化部署实战:构建企业级Windows批量装机与PXE网络引导环境
windows·mdt自动化部署·wds网络启动·pxe引导·windows批量装机·任务序列·无人值守安装
学IT的周星星2 天前
记忆系统:让 Agent 记住你是谁、上次聊到哪
运维·服务器·人工智能·windows·大模型·llm·agent
撞强2 天前
Windows 上从零开始:Obsidian + Copilot(Icompify)+ 客户洞察实战 · 图文指南
windows·copilot·obsidian·icompify