File tree 1 file changed +10
-3
lines changed
Tools/SystemDebug/efi_application/tools
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,19 @@ if ($Results.PartitionStyle -eq "MBR") {
57
57
Write-Error " Please convert disk to GPT first"
58
58
exit
59
59
}
60
+ Reset-PhysicalDisk - FriendlyName $Results.FriendlyName
60
61
61
- Initialize-Disk - FriendlyName $Results.FriendlyName - PartitionStyle GPT - PassThru |
62
- New-Partition - UseMaximumSize - GptType " {c12a7328-f81f-11d2-ba4b-00a0c93ec93b}" - AssignDriveLetter |
62
+ try {
63
+ Initialize-Disk - FriendlyName $Results.FriendlyName - PartitionStyle GPT - PassThru
64
+ }
65
+ catch {
66
+ Write-Output " Disk cannot be initialised"
67
+ }
68
+
69
+ $Drive = New-Partition - DiskNumber $Results.DiskNumber - UseMaximumSize - GptType " {c12a7328-f81f-11d2-ba4b-00a0c93ec93b}" - AssignDriveLetter |
63
70
Format-Volume - NewFileSystemLabel " EFI" - FileSystem FAT32 - Force
64
71
65
- $USBDrive = ($Results .DriveLetter + ' :\' )
72
+ $USBDrive = ($Drive .DriveLetter + ' :\' )
66
73
67
74
$RelativePath = " \\EFI\\Boot"
68
75
$DestPath = $USBDrive + $RelativePath
You can’t perform that action at this time.
0 commit comments