Guide to Check Disk Space Using PowerShell [2024 Tutorial]

Tracy King updated on Jan 12, 2024 to Partition Master | How-to Articles

This guide aims to introduce multiple ways to check disk space with PowerShell and an alternative tool to show disk usage.

Many Windows users want to check their disk space using PowerShell, but they might find it confusing to perform operations. This tutorial aims to introduce multiple ways to check disk space with PowerShell and an alternative tool to show disk usage.

⏱️Duration: 5-10 minutes
🎯Goal: Check disk space with Powershell script on Windows computers
🧰Tools:

When to Check Disk Space with PowerShell

Here are a few examples of specific situations or symptoms that may prompt you to check your computer's disk space using PowerShell:

  • The disk gets full for no reason
  • The computer system gets slow or repeatedly freezes up
  • Unable to install new applications or updates
  • Cannot save or open files
  • Files or apps taking a long time to load
  • Low disk space warnings

If you have experienced any of the situations mentioned above, you can refer to the tutorial in the coming section and check disk space using PowerShell.

How to Check Disk Space in PowerShell [With Pictures]

There are multiple methods available to check the disk space in PowerShell. This section introduces the three most commonly used ways to check your disk space using PowerShell commands. Comparatively, these are less complicated and functional for Windows users.

Way 1. PowerShell Check Disk Space via the Get-Volume Command

Get-Volume is the easiest command to find disk storage information. Using this command, you can check the space details of all the volumes at once. It displays the essential information, including health, system type and free/used space in GB. In addition, we will show how you can check the storage space information of a specific drive.

1) Show All Volumes and space allocation

Step 1: Go to the Search bar and type PowerShell.

Step 2: Select the "Run as Administration" option.

Step 3: Type Get-Volume in PowerShell window and hit Enter.

Now, you will find a list of partitions along with their information. 

2) Show a Specific drive

To inquire about the details of a specific drive, such as the C drive, insert the following command: Get-Volume -DriveLetter C. If you want to get the information for another drive, simply replace the drive letter accordingly.

Way 2. PowerShell Check Disk Space via the Get-PSDrive Command

It is another effective yet simple way to check disk space using cmdlet. Here are two different commands to follow:

# 1. Check the Space of All Drives

This command displays the free disk space of all drives in GB.

Step 1: Open the PowerShell window.

Step 2: Type Get-PSDrive command, and hit Enter to run it. 

It will display a detailed view of used/free disk space, provider, and root of all partitions in the local drive.

# 2. Check the Space of a Specific Drive

Check the used/free disk space for a particular drive by running the following command: Get-PSDrive C. Replace the latter of the target drive instead of C.

Way 3. PowerShell Get Disk Space via the Get-WmiObject Command

This method is a slightly complicated but practical alternative compared to the earlier-mentioned methods. It provides detailed information about your drives. Two scripts of this method provide detailed information, including media type, drive's total size in GB, and employed/free space. 

1) Check Total Allocated Space

Select the following command, copy and paste it into PowerShell, and hit Enter. 

  • Get-WmiObject -Class win32_logicaldisk | Format-Table DeviceId, MediaType, @{n="Size";e={[math]::Round($_.Size/1GB,2)}},@{n="FreeSpace";e={[math]::Round($_.FreeSpace/1GB,2)}}

See the displayed details. You can easily determine the space allocation of all partitions of the local drive.

2) Check the Storage Capacity Assigned to Each Drive

Run the following command to check the detailed space portion of each drive specifically. It shows free/total disk space and the free percentage of each drive in your computer. 

All you need to do is drag and drop the given command on PowerShell. See the screenshot to know how it works.

  • Get-WmiObject -Class Win32_LogicalDisk |
  • Select-Object -Property DeviceID, VolumeName, @{Label='FreeSpace (Gb)'; expression={($_.FreeSpace/1GB).ToString('F2')}},
  • @{Label='Total (Gb)'; expression={($_.Size/1GB).ToString('F2')}},
  • @{label='FreePercent'; expression={[Math]::Round(($_.freespace / $_.size) * 100, 2)}}|ft

Personal Thoughts:
PowerShell is a practical solution for checking disk space, however, it can be challenging for beginners to use. Also, an incorrect command can lead users to unexpected data loss. In short, PowerShell may not be the best option for those who haven't prior experience due to its complexity and difficulty of operation.

 

If you are a beginner without extensive computing experience or familiarity with PowerShell, we recommend using a reliable third-party tool - EaseUS Partition Master. You can take a view of this software in the next part.

Bonus Tip: Check Disk Space with PowerShell Alternative Software

EaseUS Partition Master is a popular alternative software to check disk space in minutes. As a free disk space analyzer, it is known for its rich features and appealing interface. It has all the options that drive users to check disk space and free it up easily. For example, by utilizing its Disk Space Analyzer feature, they can view information for individual drives without requiring a scan.

A single click can scan all the drives on your local computer. It offers lots of user-friendly functionalities to help users. For a step-by-step guide, you may follow this tutorial for help:

Step 1. Launch EaseUS Partition Master and turn to Discovery. Find and Download Space Analyzer below Frequently Used Tools.

Step 2. In the Space Analyzer pop-up window, select the target disk to be analyzed and click Analyze in the upper right corner.

Step 3. Wait a while, and you will see the detailed data. You can click on Folder/File to view different data types and click on the small folder icon to see more information inside the file.

This tool also assist you in checking the total disk space on a newer operating system, such as Windows 11:

How to Check Total Disk Space in Windows 11

This passage will provide three ways to use a professional disk space analyzer, Windows Setting, Disk Management, and CMD to check hard drive space. 

EaseUS Partition Master VS PowerShell, What Makes This Software Stand Out In Checking Disk Space

Here is a comparison table, and you can take a view and learn what makes EaseUS Partition Mater with its Disk Space Analyzer feature surpass PowerShell:

EaseUS Partition Master PowerShell
  • Free to analyze disk space
  • Easy to use, support all Windows OS
  • Efficient and fast for all levels of users
  • Bonus features in managing disk space
  • Free
  • Available in most Windows systems
  • For advanced Windows users, not user-friendly for beginners

In addition, EaseUS Partition Master is not only a tool for checking disk space but also allows you to manage disk space with the listed features below, including:

  •  Migrate OS and clean up data.
  • Perform most management tasks automatically. 
  • Check and manage hard drives, including creating, formatting, and partitioning.

A Brief Review of PowerShell

PowerShell is an efficient command-line shell and scripting language tool. It is designed to manage Windows administrator tasks using multiple commands, scripts, and modules. Windows users can perform different tasks, including checking disk space, installing Windows Updates, etc. 

PowerShell works seamlessly on all Windows operating systems. Its extensive array of cmdlets provides users with multiple options to execute tasks. For instance, users can choose from several commands to check disk space with PowerShell and can also enhance the level of detailed results by adding different commands. As a result of its versatility, this tool is extensively used by professionals.

If you feel like the provided tips on this page for checking disk space with PowerShell or its alternative tool, share and help more friends around you online:

 

Conclusion 

We hope this tutorial helps you to check and manage your disk space. You are free to opt for any method to get the work done. However, we recommend only advanced Windows users should operate the PowerShell utility. Whereas beginners can employ EaseUS Partition Master because it is effortless to operate with any level of expertise.

In addition, we advise you to follow the given tips and manage your disk space more efficiently:

  • Separate and store document files from the system
  • Extend and leave enough space in the C drive
  • Clean up and remove useless junk files or large files timely
  • Clear cache or temporary files if necessary
  • Utilize OneDrive's cloud storage for rarely used files
  • Regularly clean the recycle bin and temporary files

FAQs About Check Disk Space Using PowerShell

Follow our FAQs section to find answers if you have more doubts about checking disk space using PowerShell.

1. What PowerShell script can I use to get the disk space report?

If you want to get the disk space report through PowerShell, run the "Get-PSDrive" script. It will show you information like used/available disk space, total capacity, and used space.

2. How do I check disk space in CMD?

You can CMD to check the disk space. Follow the steps:

Step 1: Open the Windows Search bar, type Command Prompt, and click Rus as administrator.

Step 2: Type wmic diskdrive get size and press Enter.

It will show you the total size of your hard drive.

3. Can I run PowerShell to check disk space on Windows Servers?

Yes, to check the disk space on Windows Servers, run the following command in PowerShell: Get-DiskSpaceReport.

The script will collect information on all the Windows Servers and save it as a CSV file on the local disk. Open File Explorer and navigate the saved file in C:\Temp\DiskSpaceReport.