PS C:\Windows\system32> Get-Disk | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru |New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume -FileSystem NTFS -NewFileSystemLabel "disk2" -Confirm:$false
You can run most of the commandlets between the pipes as individual commands (not sure that makes it any easier).
Anyway, once I had my test drive, it was time to expand it. I halted the system and then made the changes in Citrix XenCenter. After restarting, I checked to see that the drive was now 40GB instead of 25GB. HOWEVER, this is misleading. Although the DRIVE is now 40GB, the partition being used is still only 25GB.
PS C:\Windows\system32> Get-Partition -DiskNumber 1
Disk Number: 1
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- --------- ---- ----
1 E 1048576 25 GB IFS
To expand the disk, I had hoped there was a simple "MaxSize" but instead I found this:
PS C:\> $size = (Get-PartitionSupportedSize –DiskNumber 1 –PartitionNumber 1)
PS C:\> Resize-Partition -DiskNumber 1 –PartitionNumber 1 -Size $size.SizeMax
Ta-dahh! Sadly, DISKPART is easier. But, for the PowerShell purists, running Windows Core 2012 R2, this does the trick.