Here's my powerShell "piped" command
Get-Disk |
Where partitionstyle -eq 'raw' |
Initialize-Disk -PartitionStyle MBR -PassThru |
New-Partition -AssignDriveLetter -UseMaximumSize -DriveLetter Z |
Format-Volume -FileSystem NTFS -NewFileSystemLabel "ephemeral" -Confirm:$false
It complains about the DriveLetter
parameter.
New-Partition : Invalid Parameter Activity ID: {e3ec7f8a-a672-4c81-a149-9440244ca230} At line:7 char:1 + New-Partition -AssignDriveLetter -UseMaximumSize -DriveLetter "Z" | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (StorageWMI:ROOT/Microsoft/Windows/Storage/MSFT_Disk) [New-Partition], CimException + FullyQualifiedErrorId : StorageWMI 5,New-Partition
The following script without it works just fine. I'm out of ideas...
Get-Disk |
Where partitionstyle -eq 'raw' |
Initialize-Disk -PartitionStyle MBR -PassThru |
New-Partition -AssignDriveLetter -UseMaximumSize |
Format-Volume -FileSystem NTFS -NewFileSystemLabel "ephemeral" -Confirm:$false