【调试记录】: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"
}
相关推荐
阿豪只会阿巴5 小时前
两小时快速入门 FastAPI--第二回
windows·python·fastapi
印度神油91 天前
Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
windows·python·ci/cd
2601_963771371 天前
Hardening Enterprise WordPress Sites Against REST API Leaks and Bad Headers
前端·windows·word·php
不要小看我们之间的羁绊啊1 天前
【windows】cc + cc switch + headroom
windows
找死的豆腐1 天前
基于.NET的Windows窗体编程之WinForms图像控件
windows·.net
XUHUOJUN1 天前
Azure Local GPU 部署与企业应用场景指南(上篇 )
windows·microsoft·架构·nvidia·azure local
AOwhisky1 天前
Python 基础语法(上篇 + 下篇)——综合自测题
linux·windows·python
埃博拉酱1 天前
Pip/Conda 混用导致的 CRT 版本冲突问题:[WinError 1114] 动态链接库(DLL)初始化例程失败
windows·python
CoderYanger1 天前
视频切割脚本(Python版)
linux·开发语言·windows·后端·python·程序人生·职场和发展
西游音月1 天前
Windows环境下的WSL+Claude Code安装配置
windows·大模型·ai编程·wsl·claude code