Checking Disk Partitions and Block Size

by Oct 4, 2013

WMI is a treasure chest full of information. This line will read local partitions along with their block sizes:

Get-WmiObject -Class Win32_Diskpartition  | 
  Select-Object -Property __Server, Caption, BlockSize 

Use Get-WmiObject’s parameter -ComputerName to do the same remotely, against one or more computers.

To see all the other WMI classes you can use in place of Win32_DiskPartition, try this:

Get-WmiObject -Class Win32_* -List |
  Where-Object { ($_.Qualifiers | Select-Object -ExpandProperty Name) -notcontains 'Association' } |
  Where-Object { $_.Name -notlike '*_Perf*' }

Twitter This Tip! ReTweet this Tip!