How to format the disk using PowerShell?

PowerShellMicrosoft TechnologiesSoftware & Coding

To format the disk using PowerShell, we can use the Format−Volume command. For example, we have to format the E: on the local server then we can use the simple format command as shown below.

Format−Volume −DriveLetter E −Force −Verbose

To format the disk with the specific filesystem use the below command.

Format−Volume −DriveLetter E −FileSystem NTFS −Full −Force −Verbose

The above command with Format the E drive with the NTFS file system (there are other file systems like FAT, FAT32, exFAT) forcefully.

You can even change the label for the drive while formatting using −NewFileSystemLabel command.

Format−Volume −DriveLetter E −FileSystem NTFS −NewFileSystemLabel "Temporary Stroage" −Full −Verbose
raja
Published on 25-Jan-2021 07:17:49
Advertisements