> ## Content Index
> Fetch the complete content index at: https://www.filipkonopik.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# PowerShell: Get Free Disk Space
- URL: https://www.filipkonopik.com/powershell-get-free-disk-space/
- Published: 2026-07-19T02:00:33.000Z
- Updated: 2026-08-06T05:23:57.000Z
- Author: Filip Konopík
- Tags: Storage Devices

Need to check how much free space is left on a drive - for capacity planning, cleanup before an update, or just monitoring a server? This one-liner pulls free space for every disk on the machine, converted into a readable format.

Prerequisites:

- Privileges: None
- Module: Built-in, no import needed

Quick Command:

```Powershell
Get-CimInstance Win32_LogicalDisk | Select-Object Name, @{Name="FreeSpaceGB";Expression={[math]::Round($_.FreeSpace / 1GB, 2)}}
```

Example Output:

```Powershell
Name FreeSpaceGB
---- -----------
C:        129.61
Y:         129.6
Z:         129.6
```

📦

****Want all of them at once?**  
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.

[Get the Complete Bundle for $39](https://gum.co/u/oczvkqdc?ref=filipkonopik.com)

How It Works:

- Get-CimInstance Win32\_LogicalDisk queries the logical disk class, which holds info about every drive letter recognized by the system, including local disks, mapped network drives, and removable media.
- FreeSpace is returned in raw bytes by default, which isn't very readable on its own (a number like 139182841856 doesn't mean much at a glance).
- The calculated property @{Name="FreeSpaceGB"; Expression={...}} creates a new custom column - Name sets what the column is called, and Expression is a script block that runs for each disk to compute its value.
- Inside the expression, $\_ refers to the current disk being processed, so $\_.FreeSpace / 1GB converts that disk's free space from bytes into gigabytes (1GB is a built-in PowerShell unit that automatically equals 1,073,741,824 bytes).
- \[math\]::Round(..., 2) rounds the result to 2 decimal places, since dividing bytes by 1GB often produces a long, unreadable decimal.