【调试记录】: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"
}
相关推荐
透明的玻璃杯3 小时前
window环境下使用类似tail的命令跟踪滚动的日志
windows
私人珍藏库3 小时前
【windows】跨平台 Android 刷机Root工具箱
android·windows·工具·刷机·软件·多功能
航Hang*7 小时前
Windows Server 配置与管理——第12章:配置数字证书服务器
运维·服务器·windows
百事牛科技9 小时前
保护文档安全:PDF限制功能实操方法
windows·pdf
夏冰加密软件9 小时前
【实测】文件加密软件解除保护的2种方法(以超级加密3000为例)
windows·安全
猫头虎9 小时前
Windows毫秒级文件名搜索工具Everything最新版下载、安装、配置、新功能解析指南
windows·everything
成都易yisdong12 小时前
实现三北方向转换计算器(集成 WMM2025 地磁模型)
开发语言·windows·算法·c#·visual studio
idolao12 小时前
Design Expert 13安装教程 Windows版:解压+自定义路径+Crack替换指南
windows
沈跃泉12 小时前
C++串口类实现
c++·windows·串口通信·串口类
dashizhi201514 小时前
电脑禁用U口、禁用USB端口、屏蔽移动存储设备使用的方法
windows·安全·电脑