When setting up a new hard drive on Windows 10, you want to format it properly to delete any data and configure a compatible file system to allow Windows to read and write data. If you are getting rid of the drive, you also want to format it to wipe out any of your personal files to prevent someone else from getting a hold of your files.
Although it might sound like a tedious process, it’s not, and Windows 10, similar to previous versions, includes a number of ways to quickly format a drive, including using PowerShell.
In this guide, you will learn the steps to use PowerShell commands to format a hard drive on Windows 10, whether it’s a new drive or you simply want to delete everything and start over.
Format drive using PowerShell on Windows 10
The process to format a drive and get it ready to store data is straightforward. Just make sure to understand that going through these steps will erase everything stored in the drive.
To format a hard drive using PowerShell commands on Windows 10, use these steps:
Search for PowerShell, right-click the result, and select the Run as administrator option.
Type the following command to identify the drive to repair and press Enter:
Type the following command to wipe out the drive on Windows 10 and press Enter:
Get-Disk 1 | Clear-Disk -RemoveData
In the above command, change 1 with the disk number of the drive you want to format (see Step No. 3). If you specify the number incorrectly, you could end up wiping out the wrong drive causing data loss.
Type A to confirm that you want to wipe the specified drive and press Enter.
Type the following command to initialize the disk with the default GUID Partition Table (GPT) partition scheme and press Enter:
Initialize-Disk -Number 1
In the above command, change 1 with the disk number of the drive you want to format (see Step No. 3).Important: Although it’s recommended to use a GPT partition scheme, if required, you can use the Master Boot Record (MBR) scheme using this command:
Initialize-Disk -Number 1 -PartitionStyle MBR.
Type the following command to format and create a new partition on the drive, and press Enter:
New-Partition -DiskNumber 1 -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel myDrive
In the above command, change 1 with the disk number of the drive you want to format on Windows 10 and change myDrive with the name to use for the storage.
Type the following command to assign a drive letter to the disk drive and press Enter:
Get-Partition -DiskNumber 1 | Set-Partition -NewDriveLetter G
In the above command, change 1 with the disk number of the drive you want to format and change G with the letter to assign to the storage. If you get the “Set-Partition: The requested access path is already in use.” error message, run the command one more time or specify a different drive letter.
Once you complete the steps, the newly formatted hard drive will appear in File Explorer.