mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 10:19:36 -06:00
Fixed an issue with RAW disks and Clear-Disk
This commit is contained in:
@@ -2963,9 +2963,13 @@ Function New-DeploymentUSB {
|
|||||||
|
|
||||||
$ScriptBlock = {
|
$ScriptBlock = {
|
||||||
param($DiskNumber)
|
param($DiskNumber)
|
||||||
Clear-Disk -Number $DiskNumber -RemoveData -RemoveOEM -Confirm:$false
|
|
||||||
Get-Disk $DiskNumber | Get-Partition | Remove-Partition
|
|
||||||
$Disk = Get-Disk -Number $DiskNumber
|
$Disk = Get-Disk -Number $DiskNumber
|
||||||
|
# Clear-Disk -Number $DiskNumber -RemoveData -RemoveOEM -Confirm:$false
|
||||||
|
if ($Disk.PartitionStyle -ne "RAW") {
|
||||||
|
$Disk | Clear-Disk -RemoveData -RemoveOEM -Confirm:$false
|
||||||
|
}
|
||||||
|
# Get-Disk $DiskNumber | Get-Partition | Remove-Partition
|
||||||
|
$Disk | Get-Partition | Remove-Partition
|
||||||
$Disk | Set-Disk -PartitionStyle MBR
|
$Disk | Set-Disk -PartitionStyle MBR
|
||||||
$BootPartition = $Disk | New-Partition -Size 2GB -IsActive -AssignDriveLetter
|
$BootPartition = $Disk | New-Partition -Size 2GB -IsActive -AssignDriveLetter
|
||||||
$DeployPartition = $Disk | New-Partition -UseMaximumSize -AssignDriveLetter
|
$DeployPartition = $Disk | New-Partition -UseMaximumSize -AssignDriveLetter
|
||||||
|
|||||||
Reference in New Issue
Block a user