title: Another grep / awk q, parsing diskpart output
body: <p>I've googled this a lot and there are a lot of similar questions but I can't figure out how to put them together to make it work for me. Also, the fact that MS decided to leave dynamic volumes out of their PowerShell cmdlets is really frustrating.</p>
  
  <p>In the following code I'm trying to identify that "Disk 2" is dynamic. </p>
  
  <pre>PS C:\Windows\system32> echo 'list disk' | diskpart
  
  Microsoft DiskPart version 10.0.14393.0
  
  Copyright (C) 1999-2013 Microsoft Corporation.
  On computer: AHPAP2704
  
  DISKPART> 
    Disk ###  Status         Size     Free     Dyn  Gpt
    --------  -------------  -------  -------  ---  ---
    Disk 0    Online           65 GB      0 B         
    Disk 1    Online           20 GB      0 B        *
    Disk 2    Offline          50 GB      0 B   *     </pre>
  
  <p>Ideally from the output above I'm going to set a variable to identify the dynamic volume (my script will always only have one) so when complete I'm left with something like <code>$DynDisk = 2</code>.</p>
  
  <p>When I pipe the output to <code>Get-Member</code> the only member types containing property in the name are <code>Chars</code> and <code>Length</code>.</p>
  
  <p>Is there an easy way to get the data into an array or a better method? Or, any chance there is some hidden <code>grep</code> and <code>awk</code> like cmdlets out there? </p>