Skip to content

Free disk space

Terminal window
Get-PSDrive -PSProvider FileSystem

Shows each drive letter with its used and free space in GB.

Terminal window
Get-Volume

Adds the label, file system (NTFS, FAT32…) and health status. Windows only.

Terminal window
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=3 means 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.
Terminal window
Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" -ComputerName SERVER01

It needs WinRM enabled on the remote machine and permissions on it.