From 80899de7e9b0ee518aeb7ad5bdf88f0be44f4cdb Mon Sep 17 00:00:00 2001 From: Mike Slattery Date: Sun, 2 Feb 2020 21:34:16 -0500 Subject: [PATCH] mbr2uefi --- tunic.ps1 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tunic.ps1 b/tunic.ps1 index 2491c13..6047412 100644 --- a/tunic.ps1 +++ b/tunic.ps1 @@ -180,10 +180,21 @@ function checks() { $partc = ( get-partition -driveLetter $global:letter ) if( (get-disk -number $partc.diskNumber).partitionStyle -eq 'MBR' ) { - if( yes('UEFI required. Would you like to read how to convert form MBR to EFI') ) { - openUrl('https://www.windowscentral.com/how-convert-mbr-disk-gpt-move-bios-uefi-windows-10') + mbr2gpt /validate /allowfullos > $null 2> $null + if( $? ) { + if( yes('UEFI required. Conversion requires BIOS change during boot. Convert from MBR to UEFI now?') ) { + mbr2gpt /convert /allowfullos > $null 2> $null + if( $? ) { + restart-computer -force + } else { + die('Could not convert to UEFI.') + } + } else { + die('UEFI required. Tunic can not run.') + } + } else { + die('UEFI required, but system cannot e converted.') } - exit 1 } $blInfo = Get-Bitlockervolume