I see. This is obviously a very destructive script, so test it at your own risk. Assuming that you only want to target local, fixed disks, you could do something like this:
Get-WmiObject Win32_LogicalDisk -Filter "DriveType = 3 AND DeviceID != '$env:SystemDrive'" | ForEach-Object { format $_.DeviceID /Q /V:"" }