最好以管理员身份运行,否则可能会报什么什么访问被拒绝之类的错
用一行命令 powershell 分析当前路径下 各个文件夹 大小 ,,,以方便人阅读的方式显示,,,按从大到小排序
Get-ChildItem -Directory | ForEach-Object {
$sizeBytes = (Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum
if ($sizeBytes -ne $null) {
$sizeMB = [math]::round($sizeBytes / 1MB, 2) # Convert to MB
if ($sizeMB -ge 1024) {
$sizeGB = [math]::round($sizeMB / 1024, 2) # Convert to GB