【调试记录】: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"
}
相关推荐
YCOSA20257 小时前
Windows11_InsiderPreview_EnterpriseVL_x64_zh-cn_29680_1000.iso 官方直链
windows
怎么没有名字注册了啊9 小时前
Windows Server 2008 R2 如何开启Aero
windows
lingchen190610 小时前
Windows CMD 的 `cd`(change directory,切换目录)命令
windows·命令模式
ITHAOGE1512 小时前
下载 | Win11 26H2 正式版发布!(ISO映像、2026年度版本、26300.9457、Windows 11)
windows·科技·微软·电脑
YCOSA202513 小时前
雨晨 Windows 11 IoT 企业版 Edge 轻装 VCDX 29680.1000
windows·物联网
笨笨努力中14 小时前
2002年Windows XP系统下载视频资源迁移云盘
windows
l1t16 小时前
修复WSL CreateInstance/E_UNEXPECTED和 mounted read-only 错误
linux·windows·wsl
kakakahahahaha16 小时前
Windows电脑卡死恢复流程:任务管理器、Ctrl Alt Delete、explorer与DWM重启
windows·电脑·笔记本电脑·软件需求·电脑卡死
kakakahahahaha17 小时前
Windows鼠标失灵排查:Ctrl Alt Delete、Mouse Keys、USB控制器与驱动修复
windows·驱动开发·电脑·笔记本电脑·软件需求
Vex2une17 小时前
Windows 资源监视器发展史:从任务管理器附件到系统级诊断利器
windows·系统监控·任务管理器·诊断工具·etw·resmon·资源监视器