mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Add conditional check to not run clear-disk on new drives that are uninitialized
This commit is contained in:
@@ -430,8 +430,10 @@ Writelog 'Clean Disk'
|
||||
#Invoke-Process diskpart.exe "/S $UEFIFFUPartitions"
|
||||
try {
|
||||
$Disk = Get-Disk -Number $DiskID
|
||||
if ($Disk.PartitionStyle -ne "RAW") {
|
||||
$Disk | clear-disk -RemoveData -RemoveOEM -Confirm:$false
|
||||
}
|
||||
}
|
||||
catch {
|
||||
WriteLog 'Cleaning disk failed. Exiting'
|
||||
throw $_
|
||||
|
||||
Reference in New Issue
Block a user