Formatting a Drive

by Jan 5, 2011

In Windows Vista and higher, there is a new WMI class called Win32_Volume that you can use to format drives. However, you should be careful when formatting data on a drive. The following line will format drive D:\ using NTFS file system, provided you have appropriate permissions:

(Get-WmiObject -Class Win32_Volume Filter "DriveLetter='D:'" ). `
Format('NTFS',$true,4096,"",$false)

Twitter This Tip!
ReTweet this Tip!