【调试记录】: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"
}
相关推荐
是一个Bug2 小时前
Java基础50道经典面试题(四)
java·windows·python
OliverH-yishuihan3 小时前
开发linux项目-在 Windows 上 基于“适用于 Linux 的 Windows 子系统(WSL)”
linux·c++·windows
a程序小傲8 小时前
阿里Java面试被问:.Java 8中Stream API的常用操作和性能考量
开发语言·windows·python
Tony11549 小时前
Windows无法安装到这个磁盘。选中的磁盘具有MBR分区表。在EFI系统上,Windows只能安装到GPT磁盘。
windows·diskgenius
love530love9 小时前
【笔记】Intel oneAPI 开发环境配置
人工智能·windows·笔记·oneapi·onednn·deep neural
分布式存储与RustFS10 小时前
实测!Windows环境下RustFS的安装与避坑指南
人工智能·windows·rust·对象存储·企业存储·rustfs
浪潮IT馆10 小时前
删除Windows系统硬盘的EFI系统分区和恢复分区
windows
我就是你毛毛哥11 小时前
windows启动jmeter
windows·jmeter
取个名字太难了a11 小时前
重写 OpenProcess:绕过 Win32 API,直接进入 NT 内核(Win7 x86)
windows
MyBFuture11 小时前
C# 哈希表与堆栈队列实战指南
开发语言·windows·c#·visual studio