Windows Server

Show Logical Disks in Windows with PowerShell

Quick & dirty, needed to loop through some servers to look at the logical volumes available on each. Using get-WmiObject you can query the available disks for Windows servers:

get-WmiObject win32_logicaldisk

There were a lot of servers, so then I realized I only cared about disks that were named a certain way. As with posix, you can pipe data, so I used where to constrain the output to those with names matching a certain disk name I was looking for:

get-WmiObject win32_logicaldisk | where {$_.name -match “SomeName”}

Isn’t server sprawl so much fun…