【调试记录】: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"
}
相关推荐
imperialeast6 小时前
WinAXP 2.4.0.828正式版
windows
周小董8 小时前
[1369]Windows上安装PostgreSQL
数据库·windows·postgresql
doujiaozh8 小时前
Win7 复活记:用 3 个补丁让 13 年前的老电脑跑通 Kimi API
windows
bbq烤鸡15 小时前
Win11 资源管理器“白条“修复报告
windows
10mAh16 小时前
【Java】ArrayList 遍历删除为什么报错?三种写法与漏删复现
java·开发语言·windows
瑶山18 小时前
Windows + WSL2 Ubuntu + VS Code配置C++开发环境
开发语言·c++·windows·vscode·wsl
在角落发呆19 小时前
一键脚本配置备份方法:从 Shell 脚本到自动备份
网络·windows
水饺编程20 小时前
第1章,[Win32 章节]:在 VS2019 里面安装 MSDN
c语言·c++·windows·visual studio
水饺编程21 小时前
第1章,[Win32 章节]:编程环境与 MSDN
c语言·c++·windows·visual studio
丨白色风车丨21 小时前
Python中JSON与字典/列表的相互转换详解
windows·python·json