관리자 권한으로 PowerShell을 실행하고 아래 스크립트를 실행한다.
$unitFactor = 1MB
$unitLabel = "MB"
Get-ChildItem . -Directory | ForEach-Object {
$folderPath = $_.FullName
$folderSize = (Get-ChildItem -Path $folderPath -Recurse -File | Measure-Object -Property Length -Sum).Sum
[PSCustomObject]@{
FolderName = $_.Name
FolderSize = [Math]::Round($folderSize / $unitFactor, 2)
Unit = $unitLabel
}
} | Sort-Object FolderSize -Descending | Format-Table -AutoSize
아래와 같이 결과가 나온다.
FolderName FolderSize Unit
---------- ---------- ----
Windows 43176.91 MB
Program Files 33170.97 MB
Program Files (x86) 26081.94 MB
Users 26030.42 MB
chrometemp 176.09 MB
Python27 66.21 MB
Temp 0.7 MB
PerfLogs 0 MB
inetpub 0 MB'운영체제 > 윈도우' 카테고리의 다른 글
| [윈도우11] 윈도우11 단축키 (0) | 2025.06.13 |
|---|---|
| [Windows 10, 11] 윈도우 인증키와 드라이버 백업 (0) | 2024.09.26 |
| [PowerShell] 로그파일 실시간 출력 (0) | 2024.01.19 |
| [Window 11] 컴퓨터 팬이 돌아가며 느려질 때 (1) | 2023.11.27 |