As a system or PowerShell administrator, you might need to monitor disk space, whether on a single PC or across hundreds of servers. In this tutorial, you’ll learn how to check hard drive space using PowerShell on Windows 10, Windows 11, and Windows Server.
Before running PowerShell commands:
- Use Windows PowerShell 5.1 or PowerShell 7+
- Run PowerShell as Administrator (especially for remote queries)
- Ensure WinRM is enabled for remote access
Now, let me show you different methods to check disk space.
Method 1: Check Disk Space Using Get-PSDrive
The simplest way to check available space is with the built-in Get-PSDrive cmdlet.
Get-PSDrive -PSProvider FileSystemOutput Example:
Name Used (GB) Free (GB) Provider Root
---- --------- --------- -------- ----
C 120 380 FileSystem C:\
D 200 800 FileSystem D:\Explanation:
Name→ Drive letterUsedandFree→ Space metrics in GBProvider→ The type of drive (FileSystem, Registry, etc.)
Best for: Quick local checks on all drives.
Here is the exact output in the screenshot below:

Check out How to Get .NET Version Using PowerShell?
Method 2: Use Get-Volume for Detailed Disk Information
For more detailed info such as filesystem type, health status, and capacity, use:
Get-VolumeExample Output:
DriveLetter FileSystemLabel FileSystem HealthStatus SizeRemaining Size
----------- ---------------- ---------- ------------ ------------- ----
C System NTFS Healthy 380 GB 500 GB
D Data NTFS Healthy 800 GB 1000 GBHere is the exact output in the screenshot below:

Tip: You can format the output for readability:
Get-Volume | Select-Object DriveLetter, FileSystem, Size, SizeRemaining, HealthStatusRead Delete User Profiles Using PowerShell in Windows 11
Method 3: Check Disk Space with WMI (Legacy but Powerful)
For advanced scripting or remote queries, WMI (Windows Management Instrumentation) is extremely useful.
Get-WmiObject Win32_LogicalDisk -Filter "DriveType=3" |
Select-Object DeviceID,
@{Name='Size(GB)';Expression={[math]::Round($_.Size/1GB,2)}},
@{Name='FreeSpace(GB)';Expression={[math]::Round($_.FreeSpace/1GB,2)}}Explanation:
DriveType=3filters for local disks only- Converts bytes to gigabytes for readability
Best for: Automation scripts and remote servers.
Method 4: Check Disk Space on Remote Computers
To query another computer’s disk space remotely:
Invoke-Command -ComputerName "Server01" -ScriptBlock {
Get-PSDrive -PSProvider FileSystem
}Pro Tip:
If you need to check multiple machines at once:
$computers = @("Server01", "Server02", "Server03")
Invoke-Command -ComputerName $computers -ScriptBlock {
Get-WmiObject Win32_LogicalDisk -Filter "DriveType=3" |
Select DeviceID, @{Name='FreeSpace(GB)';Expression={[math]::Round($_.FreeSpace/1GB,2)}}
}Check out Track User Login History on Windows Using PowerShell
Method 5: Export Disk Space Report to CSV
To generate a disk space report for auditing or monitoring:
Get-WmiObject Win32_LogicalDisk -Filter "DriveType=3" |
Select-Object DeviceID,
@{Name='Size(GB)';Expression={[math]::Round($_.Size/1GB,2)}},
@{Name='FreeSpace(GB)';Expression={[math]::Round($_.FreeSpace/1GB,2)}} |
Export-Csv "C:\Reports\DiskSpaceReport.csv" -NoTypeInformationNow you can open the report in Excel or Power BI for analysis.
Method 6: Send Email Alerts When Disk Space Is Low
You can automate alerts when free space drops below a certain threshold.
$threshold = 10 # GB
$drives = Get-WmiObject Win32_LogicalDisk -Filter "DriveType=3"
foreach ($drive in $drives) {
$free = [math]::Round($drive.FreeSpace / 1GB, 2)
if ($free -lt $threshold) {
Send-MailMessage -To "admin@company.com" -From "server@company.com" `
-Subject "Low Disk Space Alert on $($drive.DeviceID)" `
-Body "Drive $($drive.DeviceID) has only $free GB free." `
-SmtpServer "smtp.company.com"
}
}Best for: IT administrators monitoring multiple servers or workstations.
Check out Set the Default Printer Using PowerShell in Windows
Common Troubleshooting
Here are some common troubleshooting tips you can follow, and these are from my experience.
| Issue | Possible Cause | Solution |
|---|---|---|
| Access denied when querying remote PC | WinRM not enabled | Run Enable-PSRemoting -Force on remote system |
| Incorrect disk size values | Bytes not converted | Use [math]::Round($_.Size/1GB,2) |
| Script not sending email | SMTP not configured | Verify SMTP server and credentials |
I hope you now understand how to check hard drive space using PowerShell using different methods.
You may also like the following tutorials:
- Set the Time Zone Using PowerShell in Windows
- Set Password for Local User in Windows 11 Using PowerShell
- How to Update PowerShell on Windows 11?
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.