【调试记录】: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"
}
相关推荐
YJlio7 小时前
7.4.5 Windows 11 企业网络连接与网络重置实战:远程访问、本地策略与故障恢复
前端·chrome·windows·python·edge·机器人·django
猪哥-嵌入式7 小时前
在Windows 11上本地部署DeepSeek-R1 14B量化版:完整避坑指南(模型不占C盘+国内网络优化)
windows·ai
小陈的进阶之路8 小时前
Python系列课(5)——数据容器
windows·python
Hical_W10 小时前
Hical 踩坑实录五部曲(二):MSVC / GCC / Clang 三平台 C++20 编译差异
linux·windows·经验分享·嵌入式硬件·macos·开源·c++20
mianfeixz11 小时前
生化危机9安魂曲修改器2026最新版
windows
hele_two11 小时前
VS Code + CMake 调用 SDL2 & SDL2_image 完整编译教程(Windows 平台)
c++·windows·vscode·图形渲染
Stream_Silver13 小时前
【JNA实战:Java无缝调用Windows API模拟键盘输入】
java·开发语言·windows
颯沓如流星13 小时前
【 Docker Desktop】基于Windows + WSL2 的环境配置, 快速部署一套Kubernetes Cluster
windows·docker·kubernetes
fred_kang13 小时前
Windows 下 Nginx 启动报错 10013 / OpenEvent 完整排查指南
运维·windows·nginx
han_hanker15 小时前
java stream的常用方法
windows