Windows 8 and Windows Server 2012 introduce helpful Powershell cmdlets for storage operations, such as Get-Disk, Get-Partition, and Get-Volume. These cmdlets were not created for legacy versions of Windows where diskpart.exe remains the go-to tool for similar data.

However, you may wish to work with diskpart.exe output data in Powershell tools, and this sample shows how to get started with diskpart.exe output parsing for Windows Powershell.

This script sample is provided only as a sample, and is not intended to serve as a solution to any technical issue. This sample is provided as-is with no support, no warranties, and confers no rights.