Run the following in a Powershell window
$disk = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'" | Select-Object Size, FreeSpace
Write-Host ("{0}GB total" -f [math]::truncate($disk.Size / 1GB))
Write-Host ("{0}GB free" -f [math]::truncate($disk.FreeSpace / 1GB))
To get a different drive letter, just change the C: in "DeviceID='C:'" to whatever drive you want.
Top comments (1)
Great Dan!, I posted another method here