The USB format tasks are key to erase all the information stored on a device, be it USB or external hard drive, this is key in cases such as:
- Manipulation by other users etc.
In general, the format of a USB in Windows 10 is done from the File Explorer by right clicking on the device and selecting Format, but this task can be done directly from the PowerShell console with a series of useful and functional variables for it. , TechnoWikis will explain how to format our USB in Windows 10 through PowerShell..
To stay up to date, remember to subscribe to our YouTube channel! SUBSCRIBE
1. Format USB from PowerShell
One of the basic methods is to access PowerShell as an administrator from the Start context menu:
In the PowerShell console we will execute the following syntax to format the USB:
Format-Volume -DriveLetter LETRA_USB -FileSystem NTFS -NewFileSystemLabel NAME
The parameters used have been:
- In the -DriveLetter line we must enter the letter assigned by the system to the USB
- In the -FileSystem line we assign the format to be set (NTFS, FAT32, etc)
- -NewFileSystemLabel allows us to add a label to the USB
At the end of the process we can see that it has been completed correctly:
In addition to this, it is possible to perform a full format, that is, a low format that takes longer but gets to erase much deeper sectors of the USB, to perform a full format we execute:
Format-Volume -DriveLetter LETRA_USB -FileSystem NTFS -Full -Force
At the end of this process we see the complete format:
2 . Clear USB from PowerShell
Another option available is to perform extra tasks on the USB from PowerShell, for this case we access PowerShell as administrator:
In the PowerShell console we are going to list the disks with the command.
In this case the USB is assigned the number 1, we erase the data from the USB taking into account the number assigned to the USB:
Get-Disk #DISCO | Clear-Disk -RemoveData
We enter Yes or the letter S to confirm the data erasure process:
Now we are going to create the new partition on the USB with the command:
New-Partition -DiskNumber #DISCO -UseMaximumSize
As we can see, it takes all the capacity of the USB, once this is done we apply the fast format to the USB using the desired file system (NTFS, FAT32, EXT4, etc):
Get-Partition -DiskNumber #DISCO | Format-Volume -FileSystem NTFS -NewFileSystemLabel NAME
When this task is completed we will see the following:
Finally, we are going to assign the letter to the USB:
Get-Partition -DiskNumber #DISCO | Set-Partition -NewDriveLetter LETTER
As we see the system recognizes it immediately, we check that the unit is available in File Explorer in Windows 10:
This has been the complete process to format a USB in Windows 10 from PowerShell.