PS: Managing Disks and Space

List all locally installed disks along with their VolumeName, Drive Letter, Total Size and Free size:

PS C:> GWMI -query "select * from Win32_LogicalDisk where DriveType ='3'" | ft -auto DeviceID,VolumeName,Size,FreeSpace

DeviceID VolumeName        Size   FreeSpace
-------- ----------        ----   ---------
C:                  53684989952 23350935552
X:       New Volume 53683941376 48905629696

PS C:>

Note: use DriveType '2' for "Removable Disk" and '4' for "Network Drive"

Refer to Win32_LogicalDisk class document for more details.

More to follow…

Leave a Reply

Your email address will not be published. Required fields are marked *