As it’s well known to us all, PowerShell is a powerful Windows built-in command-line shell and scripting environment tool. It can be used to handle various works such as installing Windows updates, PowerShell get folder size, PowerShell SSH, PowerShell unzip/zip, PowerShell runs exe, and the one discussed in this post.
Can PowerShell Get Disk Space
- PowerShell Get-Volume: This cmdlet will show a list of all the volumes available on your system, including the file system type, health status of each volume, and total/free disk usage size in GB.
- PowerShell Get-PSDrive: This cmdlet can return you with a list of all drives on your system, including provider, root, and total used/free disk space size in GB.
- PowerShell Get-WmiObject: This cmdlet plus the win32_logicaldisk PowerShell script can display the total size, allocated, and free space of the logical drives.
- PowerShell Get-CimInstance: This cmdlet can get total and free disk space on a local or remote computer.
How to Check Disk Space PowerShell on Windows 10/11
Now, I believe that you already have known all the PowerShell disk space check cmdlets. Let’s see how to let PowerShell check disk space using these cmdlets on Windows 10/11.
Way 1. PowerShell Get Disk Space via the Get-Volume Command
# 1. Show All Drives and Space Allocation on the Computer
Now, you should find a list of drives and their information, including free disk space and total disk space on the local computer.
# 2. PowerShell Free Disk Space for a Specified Drive
Get-Volume -DriveLetter C
Way 2. PowerShell Get Disk Space via the Get-PSDrive Command
Another simple way is to use the Get-PSDrive PowerShell disk usage check cmdlet. Here’s how to use this cmdlet.
# 1. Show Free Disk Space for All Drives on the Computer
If you want to know the free disk space of all drives in GB, you can directly run the Get-PSDrive cmdlet in PowerShell. Once run, you can view the used/free disk space, provider, and root for all drives.
# 2. Show Free Space for a Particular Drive
To get the used/free disk space for a specified drive, you just need to run Get-PSDrive + drive letter command. Here we take C drive for example.
Way 3. PowerShell Get Disk Space via the Get-WmiObject Command
If you want to get the all information about your logical drives, the Get-WmiObject plus Win32_logicalDisk PowerShell script is a good choice. Here’s how to use this cmdlet.
# 1. Show Free Space for All Drives on the Local Computer
# 2. Check Free Disk Space on Remote Computers
If you want to know the total free disk space on the remote computers, you can also use the Get-WmiObject cmdlet. Here you need to replace the computer name according to the actual situation.
Get-WmiObject -Class Win32_logicalDisk -ComputerName srv01,srv02,srv03
Way 4. PowerShell Get Disk Space via the Get-CimInstance Command
In addition, the Get-CimInstance cmdlet can help you check free disk space on both local and remote computers.
# 1. Show Free Disk Space of All Drives on a Local Computer
# 2. Get Free Disk Space on Remote Computers
Better Alternative to PowerShell Get Free Disk Space
Although PowerShell can help you check free disk usage on Windows, these cmdlets are too complex and hard to remember. So, we highly recommend you use an easier and more practical alternative to PowerShell check disk space – MiniTool Partition Wizard.
MiniTool Partition Wizard FreeClick to DownloadClean & Safe
With this MiniTool software, you can get all the basic information of all drives like system file type, total/used/free space, and used percentage. More importantly, it can help your free up disk space using many powerful features like Space Analyzer, Extend/Resize/Move Partition, Migrate OS to larger HDD/SSD, etc.