【调试记录】: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"
}
相关推荐
这儿有一堆花1 小时前
用原生脚本编写无害恶作剧
windows
因我你好久不见1 小时前
Windows部署springboot jar支持开机自启动
windows·spring boot·jar
夜流冰1 小时前
Excel - MS Support for Excel: 2 Collaborate
数据库·windows·excel
林瞅瞅2 小时前
PowerShell 启动卡顿?内存飙升?原来是 800MB 的历史记录在作祟!
windows
Shepherd06192 小时前
【Windows Server 实战】WAC 反向代理配置
windows
云小逸3 小时前
【windows系统编程】第一章 Windows 系统核心架构与基础概念
windows·架构
怣疯knight4 小时前
Docker Desktop 4.55.0版本安装成功教程
windows·docker
liulilittle6 小时前
VEthernet 框架实现 tun2socks 的技术原理
网络·windows·c#·信息与通信·通信
独钓寒江雨6 小时前
win11在安全模式下删除360tray.exe
windows·电脑
PieroPc7 小时前
Windows 远程到 PVE 9.X Mac os (像window远程桌面)
windows·mac·远程桌面