【调试记录】: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"
}
相关推荐
环能jvav大师2 小时前
Electron桌面应用开发:创建应用
前端·javascript·windows·ui·electron·前端框架
环能jvav大师2 小时前
Electron桌面应用开发:自定义菜单
开发语言·前端·javascript·windows·electron
一只_程序媛2 小时前
【leetcode hot 100 54】螺旋矩阵
windows·leetcode·矩阵
battlestar3 小时前
WPF 解决加载顺序,Combox 增加属性,并关联text
windows·wpf
Sagice4 小时前
获取Kernel32基地址
windows·内核·windbg·内存·kernel32
程序员JerrySUN6 小时前
在 Ubuntu 20.04 上交叉编译 Qt 5 应用,使其可在 Windows 运行
windows·qt·ubuntu
自由鬼8 小时前
部署Windows Server自带“工作文件夹”实现企业网盘功能完整步骤
windows·企业网盘·协同办公·网盘
多多*8 小时前
谈谈单例模式中通过Htools包的SpringUtil.getBean获取Bean的好处
java·开发语言·windows·单例模式·面试·log4j
得有个名10 小时前
Windows 使用 Docker + WSL2 部署 Ollama(AMD 显卡推理)搭建手册‌
windows·docker·容器
摸鱼 特供版10 小时前
一键无损放大视频,让老旧画面重焕新生!
windows·学习·音视频·软件需求