Need to check how much disk space is being used in Windows? The simplest way is with PowerShell, a built-in command-line tool that provides detailed, real-time insights into your storage. This method works across all Windows versions, from Home to Pro, and is just as effective on servers or remote machines. No extra software is needed—just open PowerShell and run a few commands.
What You'll Need
- Windows operating system (PowerShell is included by default).
- Admin or elevated privileges may be required for certain commands (like checking all drives).
- A computer with an active internet connection (optional—some commands pull data from Windows Update).
Step-by-Step
- Open PowerShell
- Press
Win + Xand selectWindows TerminalorPowerShellfrom the list. If you see a security prompt, clickRun as administrator. - Alternatively, search for
PowerShellin the Start menu and open it.
If you’re using an older version of PowerShell (v1), upgrade to a newer version via the Windows Update settings (Settings > Update & Security > Windows Update).
- Press
- Run the basic disk usage command
- Type
Get-Diskand pressEnter. This lists all physical disks, their size, and whether they’re bootable. - Select the disk you want to inspect (usually Disk 0 or Disk 1) and run
Get-Partitionto see partitions. Note the partition number (e.g.,1) for the next step.
For example:
Get-Disk | Where-Object {$_.HealthStatus -eq 'Healthy'} | Get-Partition -Number 1filters to show only healthy partitions. - Type
- Check used space for a specific partition
- Run
Get-Volumeto list all volumes. Note the drive letter (e.g.,C:) or partition number. - Use
Get-Volume -DriveLetter C:to see detailed stats for that drive. Key outputs include:FileSystem(e.g., NTFS, FAT32)Size(total capacity)FreeSpace(unused space)UsedSpace(calculated automatically)
Example output snippet:
DriveLetter : C: FileSystemType : NTFS Size : 100GB FreeSpace : 20GB UsedSpace : 80GB - Run
- Advanced: List all files/folders by size
- For a specific folder (e.g., C:\Users\YourName\Downloads ), run:
- Replace
Downloadswith your folder path. This sorts files from largest to smallest. - For the entire system drive, use:
Note: This may take minutes for large drives. Use
-Recurseto include subfolders:ls C:\ | Where-Object { $_.PSIsContainer } | Get-ChildItem -Path * -Recurse -File | Get-ItemProperty *Size* | ... - Use Get-WmiObject for older systems (pre-Windows 8)
- Run
Get-WmiObject Win32_LogicalDiskto list all drives with their free space in bytes. - Filter with:
- Run
Common Mistakes
- Using the wrong drive letter: Always verify the drive before running size commands. For example, if you’re checking
D:, useGet-Volume -DriveLetter D:rather than accidentally running it forC:. This can cause data loss warnings or incorrect results. - Ignoring admin rights: Some commands (like
Get-Partition) require elevation. If you see errors, open PowerShell as administrator. - Not filtering healthy disks: Commands like
Get-Diskmay show offline or failed disks. Use-HealthStatus Healthyto limit results. - Overlooking partitions: A physical disk may contain multiple partitions. Use
Get-Partitionto identify them before querying space.
Tips
- Save results to a file: Redirect output for later review:
Get-Volume | Export-Csv -Path "DiskUsage.csv"This creates a CSV file for analysis in Excel or Notepad. - Check remote drives: Use
Get-Volume -PSPath \\ServerName\ShareNameto inspect network drives. - Monitor trends: Schedule PowerShell scripts to run weekly (via Task Scheduler) and log results for capacity alerts.
- Compare across drives: Run
Get-Volume | Select-Object DriveLetter, FileSystem, Size, FreeSpace, UsedSpacefor a quick comparison of all drives. - Use aliases for convenience: Add these aliases to your PowerShell profile (edit
~\.profile):alias vs="Get-Volume Size FreeSpace UsedSpace"Then typevsto see disk stats quickly.
Troubleshooting
If the commands fail or return unexpected results:
- Check disk health: Run
Get-Disk | Where-Object {$_.HealthStatus -ne 'Healthy'} | Select-Object Number, HealthStatus. Fix failing disks before further inspection. - Verify permissions: Ensure your account has read access to the folders you’re checking. For example, if
ls C:\Program Filesfails, you lack permissions. - Try alternative commands:
- For file sizes, use
- For a quick summary, use
dir /s /q C:\in Command Prompt (short for "list all files under C: with /s for recursive and /q for quiet mode").
- Check for antivirus interference: Some security software may block PowerShell execution. Temporarily disable it or add PowerShell to the exclusion list.
- Reboot if needed: Rarely, disk operations may stall due to background processes. Restart your PC if commands hang indefinitely.
If you get "Access Denied" errors:
- Run PowerShell as administrator.
- Check if the folder is read-only (right-click > Properties > Security).
- Ask the system administrator if you need elevated access to specific folders.
Frequently Asked Questions
What’s the fastest way to see disk space in PowerShell?
Use Get-Volume in a single line for instant results, or redirect to a file for quick access:
Get-Volume | Export-Csv -Path "Disk_Info.txt"
How do I check disk space for a specific folder?
Run . This sums all file sizes in gigabytes.
Why does PowerShell say "No drives are available"?
This usually means:
- The drive is offline (power issue, faulty cable, or disconnected).
- The drive is formatted with an unsupported filesystem (e.g., exFAT on older systems).
- Your account lacks permissions to access the drive.
Get-Disk for available disks.
Can I use PowerShell to check external drives?
Yes. Connect the external drive, then run:
Get-Volume | Where-Object { $_.DriveLetter -notlike "*:" } | Select-Object DriveLetter, FileSystem, Size, FreeSpace
(Note the -notlike "*:" filter excludes local drives.)
How do I remove temporary files that might be using too much space?
PowerShell can help with cleanup:
Get-ChildItem -Path "$env:TEMP" -Recurse -ErrorAction SilentlyContinue | Remove-Item -Force
For system temp files (e.g., Windows cache):
Get-ChildItem -Path "C:\Windows\Temp" -Recurse -ErrorAction SilentlyContinue | Remove-Item -Force
Warning: These commands permanently delete files. Backup important data first if needed.
Why does my disk space report show 0KB free when I know there’s space?
Possible causes:
- You’re checking a read-only partition (e.g., system reserves space).
- The filesystem is full but not reported accurately (e.g., NTFS with reserved space for hibernation).
- You’re looking at the wrong drive letter (e.g.,
C:vs.D:).
Get-Volume | Where-Object {$_.UsedSpace -gt ($_.Size - $_.FreeSpace)} to flag drives with "surprising" usage.