Clean and Format a Flash Drive

More Ways: https://www.windowscentral.com/how-format-usb-flash-drive-windows-10

PowerShell

This works even if the USB flash drive has unknown (UNIX) partitions.
Filesystems can be NTFS, FAT32 or exFAT.
This will completely remove any data on the USB flash drive.

To clean and format a removable drive with PowerShell, use these steps:

Run PowerShell as administrator:

Get-Disk
New-Partition -DiskNumber DISK-NUMBER -UseMaximumSize
Get-Partition -DiskNumber DISK-NUMBER | Format-Volume -FileSystem FILE-SYSTEM -NewFileSystemLabel DRIVE-NAME
Get-Partition -DiskNumber DISK-NUMBER | Set-Partition -NewDriveLetter DRIVE-LETTER