I'm trying to format an USB drive with powershell. The only problem is that it ereases everything of the disk but doesn't create a partition.
And I don't know how to get this working. Does anyone have an idea?
$driveLetter = "D";
Format-Volume -DriveLetter $driveletter -NewFileSystemLabel "Formated USB drive" -Force -FileSystem NTFS;
Error Message:
Format-Volume : Invalid Parameter
Activity ID: {dcc55555-5b20-4fe0-9abf-4d40078f4c36}
At C:\formatUsb.ps1:2 char:9
+ Format-Volume -DriveLetter $driveletter -NewFileSystemLabel $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimE
xception
+ FullyQualifiedErrorId : StorageWMI 5,Format-Volume