Q: How can I initialize and format a volume using Windows PowerShell?

A: If you need to initialize and format a volume using PowerShell, use the following:

First, get a list of the disks so you know which disk number you want to initialize:

Get-Disk

Next initialize the disk which by default will use GPT:

Initialize-Disk 1

Next create the partition, format, label and assign a different drive letter if required:
 

New-Partition -DiskNumber 1 -AssignDriverLetter -UseMaximumSize

Format-Volume -DriveLetter E -FileSystem NTFS

Set-Volume -DriveLetter E -NewFileSystemLabel "Pagefile"

Set-Partition -DriveLetter E -NewDriveLetter P