【调试记录】: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"
}
相关推荐
gentle coder16 小时前
testOne
windows
~黄夫人~17 小时前
零基础速通|Windows&Linux 常用命令行对照表大全
linux·运维·windows·笔记·备忘录·整理表格
一个人旅程~19 小时前
linux如何“抢”过windows的usb移动硬盘权限对0磁道损坏的移动硬盘进行尝试修复
linux·windows·经验分享·电脑
Keano Reurink20 小时前
长尾关键词自动化扩展:从1个种子词到1000个长尾词
运维·windows·自动化
新时代农民工~21 小时前
PostgreSQL 主从复制(流复制)实战配置指南:Windows 环境详细步骤
数据库·windows·postgresql
AI周红伟1 天前
通用业务智能体OpenClaw+Skills+RAG+Agent构建案例实操
大数据·人工智能·windows·百度·copilot
a58808111 天前
WarCraft III《魔兽争霸3冰封王座》原版安装包——游戏玩法、配置要求与详细安装教程
windows·游戏·游戏程序
xiaobobo33301 天前
Ubuntu 26.04环境搭建过程中遇到无法粘贴和SecureCRT提示信息过多问题
ubuntu·终端
Chirp1 天前
Windows下借助wsl2读取ext4格式磁盘
linux·windows
CAE虚拟与现实1 天前
img格式的文件在windows上怎么打开
windows·img文件·微软img