Free disk space
Quick look
Section titled “Quick look”Get-PSDrive -PSProvider FileSystemShows each drive letter with its used and free space in GB.
Volumes
Section titled “Volumes”Get-VolumeAdds the label, file system (NTFS, FAT32…) and health status. Windows only.
A tidy table with percentages
Section titled “A tidy table with percentages”Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" | Select-Object DeviceID, @{ n = 'SizeGB'; e = { [math]::Round($_.Size / 1GB, 1) } }, @{ n = 'FreeGB'; e = { [math]::Round($_.FreeSpace / 1GB, 1) } }, @{ n = 'Free%'; e = { [math]::Round($_.FreeSpace / $_.Size * 100) } }DriveType=3means local disks; it leaves out USB sticks, DVD drives and network drives.- The
@{ n = …; e = … }blocks are calculated properties: a column name and the expression that fills it.
On a remote machine
Section titled “On a remote machine”Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" -ComputerName SERVER01It needs WinRM enabled on the remote machine and permissions on it.
See also
Section titled “See also”- Disk usage, to find out what is using the space.
- The Linux version: Free disk space.