Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Format Partition

$
0
0

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:""
}

Viewing all articles
Browse latest Browse all 13067

Trending Articles