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