【调试记录】: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"
}
相关推荐
꧁坚持很酷꧂15 分钟前
Windows安装Qt Creator5.15.2(图文详解)
开发语言·windows·qt
Heart_to_Yang1 小时前
Telnet 调试屏幕输出信息卡死问题解决
网络·windows·经验分享
杼蛘3 小时前
XXL-Job工具使用操作记录
linux·windows·python·jdk·kettle·xxl-job
qq_251533593 小时前
查找 Python 中对象使用的内存量
开发语言·windows·python
JH灰色3 小时前
【大模型】-LangChain--Agent
windows·microsoft·langchain
世转神风-4 小时前
windows-ps1-脚本-删除文件
windows
TToolss4 小时前
新手使用frp,3端全部Windows
windows
普通网友5 小时前
24年9月最新微软copilot国内Windows11强制开启使用教程方法
windows·ai·微软·copilot
qq_420443275 小时前
AMD显卡在windows中通过WSL安装使用stable diffusion(WebUI和ComfyUI)
linux·windows·ubuntu·stable diffusion·wsl
网安入门学习5 小时前
2025年AIGC人才需求报告:从招聘数据看行业趋势与技能要求
人工智能·windows·ai作画·stable diffusion·aigc