- To fix USB drive problems on Windows 11, open PowerShell (as an administrator), run the “Get-Disk 7 | Clear-Disk -RemoveData” command to clear and repair the drive, then run the command to create a new partition and assign a drive letter.
- This process completely erases the USB flash drive’s data and partition to fix issues such as corruption and other errors, then configures the drive as a fresh device.
On Windows 11, connecting a USB flash drive should be a simple plug-and-play experience, but that’s not always the case. You may encounter errors like “Please insert a disk into USB drive” or “Windows was unable to complete the format” when trying to access or reformat the storage. These messages usually point to corruption, partition issues, or problems caused by improperly created bootable media.
In most scenarios, the quickest way to fix these issues is to completely wipe the drive and recreate its partition structure. Windows 11 includes built-in tools that make this process straightforward, and using PowerShell provides a faster, more reliable way to reset virtually any removable storage device, including USB flash drives and SD cards.
This approach is especially useful if the drive was previously used as bootable installation media, as leftover configurations can prevent the device from being recognized or formatted correctly. By clearing and rebuilding the partition, you can restore the drive to a clean, usable state and resolve detection and formatting issues in a single process.
In this guide, I’ll outline the steps to repair an inaccessible USB flash drive so you can reformat it on Windows 11.
Repair USB drive using PowerShell on Windows 11
To repair a USB drive with PowerShell commands on Windows 11, follow these steps:
-
Open Start on Windows 11.
-
Search for PowerShell, right-click the result, and select the Run as administrator option.
-
Type the following command to identify the USB flash drive and press Enter:
Get-Disk
-
Type the following command to erase the entire drive and press Enter:
Get-Disk 1 | Clear-Disk -RemoveData
In the command, change “1” to the disk number of the drive you want to repair. If you specify the number incorrectly, you could wipe out the wrong drive, causing data loss.
-
Type
Ato confirm that you want to wipe the specified drive and press Enter. -
Type the following command to create a partition using the NTFS file system and assign a name for the USB drive, and press Enter:
New-Partition -DiskNumber 1 -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel myUSBflash
In the command, change “1” to the disk number of the USB drive you want to repair and change “myUSBflash” to the name you want to use for the storage.
-
Type the following command to assign a drive letter to the removable drive and press Enter:
Get-Partition -DiskNumber 1 | Set-Partition -NewDriveLetter F

In the command, make sure to change “1” with the disk number of the flash drive to repair and change “F” with the letter to assign to the storage.
Once you complete the steps, the USB flash drive should appear in File Explorer unless it’s physically broken, in which case you will need a replacement.
I have tested these steps, and as you can see in the screenshot above, the drive is accessible after running the PowerShell command.
FAQs about repairing USB drive using PowerShell
Here’s a list of frequently asked questions (FAQs) and answers about fixing access to a USB flash drive on Windows 11.
How do I fix “Please insert a disk into USB drive” on Windows 11?
You can fix this error by completely wiping and recreating the USB drive partition using PowerShell. Run administrative commands like Clear-Disk to remove corrupted data, then create a new partition and assign a drive letter. This process restores the drive to a clean, usable state.
What does the Clear-Disk command do in PowerShell?
The Clear-Disk command removes all data and partition information from a storage device. It essentially resets the drive to an uninitialized state, eliminating corruption or formatting issues and preparing it for a fresh partition and file system configuration.
Why does Windows 11 say “Windows was unable to complete the format”?
This error usually indicates file system corruption, damaged partitions, or issues from previously created bootable media. When standard formatting fails, using PowerShell to fully erase the disk and rebuild the partition structure often resolves the problem.
Is PowerShell better than Disk Management for fixing USB drives?
PowerShell is generally more reliable for fixing problematic USB drives because it allows low-level disk operations like clearing and rebuilding partitions. Disk Management works for basic tasks, but it may fail when dealing with corrupted or unrecognized drives.
Will repairing a USB drive with PowerShell delete all data?
Yes, repairing a USB drive with PowerShell deletes all data. Commands like Clear-Disk completely wiping the storage, including partitions and files. You should back up any important data before proceeding, as the process cannot be reversed.
How do I recreate a USB drive partition using PowerShell on Windows 11?
To recreate a partition, use PowerShell to first clear the disk, then run commands like New-Partition and Format-Volume to create and format a new partition. Finally, assign a drive letter so the system can recognize and access the device.
Why isn’t my USB drive recognized after I use it as bootable media?
A USB drive may not be recognized after being used as bootable media due to leftover partition configurations or incompatible file systems. Clearing the disk and recreating the partition removes these configurations and restores normal functionality.
Update April 16, 2026: This guide has been updated to ensure accuracy and reflect changes to the process.