【调试记录】: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"
}
相关推荐
CODER03045 小时前
封装忽律底层硬件差异的自定义系统
windows·microsoft
软件资深者6 小时前
Windows10、11轻松设置 使用教程:把Windows繁杂的设置集成到一个面板,关广告/关更新/调隐私全搞定,系统设置工具新手 5 分钟上手(2026)
windows
脚踏实地皮皮晨6 小时前
003005002_WPF StackPanel 基类官方类定义逐行深度解析
开发语言·windows·算法·c#·wpf·visual studio
YCOSA20257 小时前
Windows 11 Insider 实验预览版 26300.9032 基于26100.6(检查点26100.1746)
windows
happymagic8 小时前
vmware workstation Pro 虚拟机设定启停的时间段
运维·服务器·windows
PC2005-cloud9 小时前
Windows 下 WSL2 + Docker Desktop + Ubuntu 开发环境搭建指南
windows·ubuntu·docker
王维同学9 小时前
跨位数进程的映像、命令行与环境块读取
c++·windows·安全
蛊明9 小时前
一台老 ThinkPad 的系统博物馆:Windows、Ubuntu、UOS、Kylin多系统共存方案
windows·ubuntu·kylin
Moshow郑锴10 小时前
qlik-cli - Get started with examples
服务器·windows·microsoft
WangWei_CM10 小时前
跨位数进程的映像、命令行与环境块读取
windows