【调试记录】: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"
}
相关推荐
飞Link10 小时前
Windows 环境下 LaTeX 的安装配置教程
windows·vscode
R.lin11 小时前
windows MySQL解压版安装教程
windows·mysql·adb
常家壮11 小时前
Windows隐藏账号创建完全指南:技术原理与安全实践
windows·安全·渗透测试·后门·windows隐藏账号
真上帝的左手14 小时前
18. 操作系统-Windows-命令提示符
windows
GHL28427109016 小时前
文件重命名(C++源码)
前端·c++·windows
fred_kang17 小时前
win11上使用SecoClient登录报错出现的SV无法连接至服务器信息
windows
丁劲犇19 小时前
Visual C++下使用Win32 API为Release模式导出崩溃堆栈
c++·windows·crash·dump·离线调试·vc·崩溃堆栈
半夏知半秋19 小时前
kibana介绍与部署(Windows详细版)
大数据·运维·windows·学习·搜索引擎·全文检索
spencer_tseng19 小时前
Insufficient permissions [windows]
windows·acrobat 9.0
浪潮IT馆20 小时前
win11安装Git
windows·git