Format-Volume: InvalidArgument: (MSFT_Volume (Ob...4-a4ab-0cf9...):ROOT/Microso ft/...age/MSFT_Volume) [Format-Volume], CimException

I am unable to format partitions created in a vhd with the Format-Volume cmdlet. I keep on getting the following output:

Format-Volume : Los valores de uno o ms parmetros pasados al mtodo no eran vlidos.
En C:\Users\Public\Convert-WindowsImage.ps1: 4205 Carcter: 44
+                         $volume          = Format-Volume -Partition $partitionFI ...
+                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (MSFT_Volume (Ob...4-a4ab-0cf9...):ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimException
    + FullyQualifiedErrorId : MI RESULT 4,Format-Volume

I have even tried re-creating the CIM object with "Get-Partition" and outputting the result to verify it. Apparently the string is OK:

MSFT_Partition (DiskId = "\\?\scsi#disk&ven_msft&prod_virtual_disk#2&1f4adffe&0&000003#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}", Offset = 240123904)

The partition was created with this line:

$PartitionMain       =New-Partition-DiskNumber$openVhd.DiskIndex -UseMaximumSize-GptType'{ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}

And in fact the partition is properly created according diskpart.

But still I am unable to format the partition with following line:

Format-Volume-Partition$PartitionMain-FileSystemNTFS-Force-Confirm:$false

As apparently the partition argument is inva

July 5th, 2015 3:50am

get-partition -DiskNumber 1 -PartitionNumber 2|format-volume

OR
$partition | Format-Volume

Free Windows Admin Tool Kit Click here and download it now
July 5th, 2015 8:53am

Apparently an assigned drive letter is required for Format-Volume to work:

$partition       = New-Partition -DiskNumber $openVhd.DiskIndex -UseMaximumSize -AssignDriveLetter -GptType '{ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}'

For some reason I do not need such previously assigned drive letter when running the script in other machines...
July 5th, 2015 9:07am

Apparently there is something wrong with my Windows setup also I cannot format newly created partitions from diskpart until I assign them a drive letter as I get a "parameter incorrect" error. I cannot reproduce this in any of my Windows VMs/machines. I suspect that a very invasive partition manager software (Paragon Partition Manager) might have left a RAW fs filter or something after uninstallation that avoids diskpart to function as expected.
Free Windows Admin Tool Kit Click here and download it now
July 9th, 2015 3:55am

I had diskpart automount set as disabled. This was causing new partitions to be created as offline RAW volumes that cannot be directly formatted until the are set online by the assignment of a drive letter. Entering the following line "automount enable" within diskpart fixed the issue and now new partitions can be formatted without having to manually assign a drive letter.
July 9th, 2015 11:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics