【调试记录】: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"
}
相关推荐
非凡ghost11 小时前
ShareX(免费截图录屏软件)
windows·学习·软件需求
Eiceblue13 小时前
.NET框架下Windows、Linux、Mac环境C#打印PDF全指南
linux·windows·.net
skywalk816314 小时前
Windows 下常见的 开源输入法(IME)
windows·开源·输入法
yingdonglan14 小时前
鸿蒙跨端Flutter学习——GridView高级功能
linux·运维·windows
JAVA+C语言14 小时前
多主机 TCP 通信
网络·windows·tcp/ip
比奇堡鱼贩17 小时前
python第二次作业--函数
linux·运维·windows
小白郭莫搞科技19 小时前
鸿蒙跨端框架Flutter学习:ListView卡片样式详解
linux·服务器·windows
九皇叔叔19 小时前
【05】SpringBoot3 MybatisPlus 添加(Mapper)
windows
水饺编程19 小时前
第4章,[标签 Win32] :系统字体与字符大小
c语言·c++·windows·visual studio
i建模20 小时前
在Windows系统上通过SSH访问远程AWS主机
windows·ssh·aws