OSD 21.2.22+

This function will clear the USB Drives. You can optionally Initialize and specify a PartitionStyle. The -Force parameter is required to actually do the work. When this parameter is not used, Get-Help will be displayed, as well as the returned Get-USBDisk results

You will be prompted to confirm Clear-Disk for each USB Drive. To fully automate things, use the following command

Clear-LocalDisk -Force -Confirm:$false

Last updated