PowerShell
System
Safe Windows PowerShell 5.1
PowerShell 7+ (Windows, macOS, Linux)
Show folder size in PowerShell
Sums the Length of every file under the path. The Sum is in bytes; divide by 1MB for megabytes.
Template
Get-ChildItem {path} -Recurse -File | Measure-Object -Property Length -SumComplete example
$ Get-ChildItem .\src -Recurse -File | Measure-Object -Property Length -SumRead-only — it reports information and does not change your system. Copying puts it on your clipboard — it runs on a real system only when you paste and press Enter there. The practice terminal is a simulator and never touches your machine.
Where it runs
Supported environments
Windows PowerShell 5.1 · PowerShell 7+ (Windows, macOS, Linux)
Expected output
Not documented yet on this page.
Verification status
Checked against official documentation — documentation reviewed on 2026-11-22. Syntax, options and requirements were reviewed against the linked official documentation. Not executed.
Documentation link last checked on 2026-11-22 (reachable).
Limitation: Documentation-only: this environment has no Windows, macOS, systemd, Docker, package-manager or network target to execute against safely.
Parameter explorer
Folder path
Template previewFill in the required values first
$ Get-ChildItem {path} -Recurse -File | Measure-Object -Property Length -SumStill a template — fill in {path}.
Parameters
- path
- Folder path
AI insights for this command
Get a plain-English explanation, expected output, common errors + fixes, safer alternatives, and best practices — generated for this exact command.
Free account — the reference below stays open to everyone.