December 4th, 2015

PowerTip: Use PowerShell to List All Volumes

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to identify all partitions on a disk drive.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily see all of the partitions on a disk drive?

Hey, Scripting Guy! Answer Pipe the Disk object through Get-Partition (to identify its partitions), then pipe that through Get-Volume to get
           the volume data. Here is an example of using this on the default hard drive (drive 0):

Get-Disk –number 0 | Get-Partition | Get-Volume

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback