wmic logicaldisk get size,freespace,caption
wmic logicaldisk get size,freespace,caption
Caption FreeSpace Size
C: 66594897920 277158555648
E: 47003512832 214747312128
N: 6186729472 61873324032
The wmic
command outputs disk sizes in bytes, but you can use a PowerShell command to get the disk usage in a more human-readable format, such as MB or GB.
Powershell
Get-PSDrive -PSProvider FileSystem | ForEach-Object {
$size = $_.Used + $_.Free
$used = $_.Used
$free = $_.Free
[PSCustomObject]@{
Name = $_.Name
"Size(GB)" = [math]::round($size / 1GB, 2)
"Used(GB)" = [math]::round($used / 1GB, 2)
"Free(GB)" = [math]::round($free / 1GB, 2)
}
}