【调试记录】: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"
}
相关推荐
程序务虚论5 小时前
mac M1上安装windows虚拟机报错
windows·macos·parallels
磊灬泽11 小时前
【日常错误】鼠标无反应
linux·windows
UNbuff_017 小时前
Windows netstat 命令使用说明
windows
您的通讯录好友18 小时前
conda环境导出
linux·windows·conda
子兮曰1 天前
🔥C盘告急!WSL磁盘暴增?三招秒清20GB+空间
前端·windows·docker
学历真的很重要1 天前
Claude Code Windows 原生版安装指南
人工智能·windows·后端·语言模型·面试·go
李游Leo1 天前
LaTeX TeX Live 安装与 CTAN 国内镜像配置(Windows / macOS / Linux 全流程)
linux·windows·macos
Jayin_chan1 天前
windows下安装claude code+国产大模型glm4.5接入(无需科学上网)
windows·claude code·glm4.5
cpsvps_net1 天前
Windows远程FX编解码优化
windows
爱睡觉的圈圈1 天前
突破反爬限制:动态IP轮换策略与实现
windows·tcp/ip·microsoft