PowerShell: wipe and re-initialize a disk with Clear-Disk
Clear-Disk -RemoveData to completely wipe a disk before re-initializing it (destructive command).
To completely wipe a disk (partitions and data) and return it to an uninitialized state before re-initializing it.
Dangerous: all data on the disk is destroyed, with no confirmation prompt.
Clear-Disk -Number 6 -RemoveData -Confirm:$false
-Number 6: the disk number (check it withGet-Diskbefore running the command).-RemoveData: removes all partitions, including data partitions.-Confirm:$false: suppresses the confirmation prompt.
The disk can then be re-initialized with Initialize-Disk.