【调试记录】: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"
}
相关推荐
百事牛科技2 小时前
WinRAR注释功能:给压缩包留个便签
windows·winrar
sukalot3 小时前
Windows 驱动实例分析系列:libwdi 驱动分析 - examples 篇(一)
windows·驱动开发
加载力科技3 小时前
硬盘咔咔响是坏盘信号!赶在数据丢失前克隆换盘:不重装系统、不丢文件
windows·嵌入式硬件·系统安全·策略模式·命令模式·硬盘
2601_962364975 小时前
电脑人脸解锁的安全基石,聊聊 Windows Hello 硬件规范
windows·安全·电脑
MIXLLRED11 小时前
Windows 搭建《动手学深度学习》PyTorch 环境:从安装到踩坑记录
pytorch·windows·深度学习
fogota11 小时前
C# `string.Join` 处理 `List<int>`
windows·c#
律宏阔1 天前
WSL Docker 端口明明空闲,但就是绑不上端口
linux·windows
律宏阔1 天前
Windows 禁用联想笔记本所有 Lenovo 后台服务
windows
律宏阔1 天前
WSL 突然断网,无法 ping 内网或外网
linux·windows
小羊没烦恼!6 天前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#