title: Powershell New-Partition - Need 4th partition to be primary not extended
body: <p>I have created a script that runs in PE to create 4 partitions and apply the images.  I have posted it below for others to review, maybe copy helpful parts :).</p>
  
  <p>I do however have one small problem with it.  DiskManager in Windows and Powershell automatically create the 4th partition as an extended partition instead of a "primary" partition.  This is not desired in my image for a few reasons I won't get into.  </p>
  
  <p><strong>Is there a way to create the 4th partition as a primary in Powershell without scripting to diskpart?</strong> </p>
  
  <p><em>Warning the below can be very destructive!</em></p>
  
  <pre><code>get-disk
  $disknumber = Read-Host 'Please enter which disk number listed above to deploy to (ex 0):'
  $getdisk=get-disk $disknumber
  $drivesizedata=($getdisk.size-86213918720)/2
  clear-disk $disknumber -removedata -confirm:$false
  initialize-disk $disknumber -partitionstyle MBR
  new-partition $disknumber -size 300MB -driveletter j
  new-partition $disknumber -size 80GB -driveletter k
  new-partition $disknumber -size $drivesizedata -driveletter l
  new-partition $disknumber -usemaximumsize  -driveletter m
  format-volume jklm -confirm:$false
  dism /apply-image /imagefile:$imagepath\OS.wim /index:1 /applydir:k:\
  dism /apply-image /imagefile:$imagepath\Data.wim /index:1 /applydir:l:\
  dism /apply-image /imagefile:$imagepath\Backup.wim /index:1 /applydir:m:\
  bcdboot /s j: /f BIOS k:\windows
  Set-Partition -DriveLetter J -IsActive $True
  </code></pre>