
New-Partition -DiskNumber Number -Size Sizegb -DriveLetter DriveLetter | Format-Volume -FileSystem NTFS -NewFileSystemLabel Label Note: Ensure that the drive letter is not being used by another volume on the computer. Replace Number with the number associated with the USB drive noted in step 1 above, Size with the size of the partition that you want to create, DriveLetter with the letter that you want to assign, and Label with the label that you want to assign to this partition. Now use the command below to create a new parition of a specific size, format it, and assign a drive letter, all in one cmdlet.Now use the following cmdlet to erase all data from the drive while replacing Number with the number associated with the USB drive noted in step 1 above.This will give you the number associated with the USB flash drive, which will be used in the steps below. Open PowerShell with administrative rights and paste the following.Here is how to create multiple partitions of a USB drive using PowerShell: You can also create multiple partitions of a USB drive using PowerShell, rather than just a single big partition. Get-Partition -DiskNumber Number | Set-Partition -NewDriveLetter DriveLetterĪfter entering the last command, the USB drive will be accessible and will automatically open in Windows Explorer. Note: Ensure the drive letter is not being used by another volume on the computer. Now assign a drive letter with the cmdlet given below, replacing the number with the disk number listed in step 1 above, and DriveLetter, which you want to assign to this USB. New-partition -DiskNumber Number -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel Label Replace Number with the number associated with the drive noted in step 1, and Label with the new label which you want to give the new volume. Now use the following cmdlet to create a single, new partition consisting of the maximum usable space on the drive.When asked for a confirmation, type in A and hit Enter.Now use the following cmdlet to erase all data from the drive, while replacing Number with the number associated with the USB drive noted in step 1 above.


Now open PowerShell with administrative rights and paste the following.Plug the USB device onto your computer.Note: This method works regardless of the drive letter being assigned to the USB drive. Follow the steps given below to format a USB drive using this tool and create a single partition.


Windows PowerShell is a powerful command-line tool in Windows that allows you to perform administrative tasks on your computer. How to Format Drive using PowerShell Create Single Partition
