【调试记录】: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"
}
相关推荐
q***01652 小时前
Windows操作系统部署Tomcat详细讲解
java·windows·tomcat
Neur0toxin6 小时前
入侵排查_2025/11/23
linux·windows·应急响应
Wuuconix8 小时前
阿三系统疑难杂症解决(输入法 + 浏览器闪屏)
windows·阿三
n***26568 小时前
Windows环境下安装Redis并设置Redis开机自启
数据库·windows·redis
A懿轩A14 小时前
【2025最新】Flutter 编译开发 鸿蒙HarmonyOS 6 项目教程(Windows)
windows·flutter·华为·openharmony·开源鸿蒙
say_fall18 小时前
WinAPI 极简教程:超简单的 Windows 接口入门
c语言·windows
晨枫阳20 小时前
不同语言数组详解
linux·服务器·windows
s***45321 小时前
【RabbitMQ】超详细Windows系统下RabbitMQ的安装配置
windows·分布式·rabbitmq
IT小哥哥呀1 天前
如何从 Windows SSH 进入 VirtualBox Ubuntu 虚拟机——密码认证(逐步指南)
linux·windows·ubuntu·ssh·教程·虚拟机
XI锐真的烦1 天前
Flutter Windows 下“Running Gradle task ‘assembleDebug‘...” 卡住一整天的终极解决办法
windows·flutter