Skip navigation
Initialize a Volume Using Windows PowerShell

Initialize a Volume Using Windows PowerShell

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

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish