Thursday, February 23, 2012
   
Text Size

PowerShell - Query Hard Drive Information

Microsoft PowerShell - Query Hard Drive Information

windows_powershell

To query the Computers Hard Drive Information:

#Return the Models of all Hard Drives in the Current PC
Get-WmiObject -Class Win32_DiskDrive |  Select Model  | Format-List

#Return the Drive Assignments for all Hard Drives in the Current PC
Get-WmiObject -Class Win32_DiskDrive |  Select Name  | Format-List

#Return the Partition numbers for all Hard Drives in the Current PC
Get-WmiObject -Class Win32_DiskDrive |  Select Partitions  | Format-List

#Return in bytes the size of all Hard Drives in the Current PC
Get-WmiObject -Class Win32_DiskDrive |  Select Size  | Format-List