【调试记录】: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"
}
相关推荐
CyL_Cly15 小时前
杀戮尖塔2mod:二次元猎宝
windows·游戏
不做菜鸟的网工17 小时前
Windows WSL 使用技巧
windows
heimeiyingwang19 小时前
【架构实战】Event Sourcing事件溯源详解
windows·架构
少控科技20 小时前
小数典 - V1.0.0.1
windows·c#
遇见火星20 小时前
Firewalld 防火墙实战指南 + TCPWrapper 七层访问控制
开发语言·windows·python
eastyuxiao21 小时前
MMM 工具一键去水印+检测 批处理脚本(Windows/Mac 双版本)
人工智能·windows·macos·ai音乐去水印
Ching·21 小时前
MAC mini上面安装虚拟机windows11的安装详细过程及其问题解决
windows·macos·wmware fusion
Controller-Inversion21 小时前
207. 课程表
windows
longerxin20201 天前
卸载 CCleaner 失败?用 Revo Uninstaller 彻底清干净(附官方下载 + 详细步骤)
windows
AC赳赳老秦1 天前
OpenClaw多平台部署:Windows+Linux跨系统协同,实现全场景覆盖
linux·服务器·前端·网络·windows·deepseek·openclaw