Update dg-readiness-tool.md

try+catch is needed to handle "Variable is currently undefined." error on some older computers

Confirm-SecureBootUEFI : Variable is currently undefined: 0xC0000100
At line:1 char:1
+ Confirm-SecureBootUEFI
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Microsoft.Secur...BootUefiCommand:ConfirmSecureBootUefiCommand) [C
   onfirm-SecureBootUEFI], StatusException
    + FullyQualifiedErrorId : GetFWVarFailed,Microsoft.SecureBoot.Commands.ConfirmSecureBootUefiCommand

https://docs.microsoft.com/en-us/powershell/module/secureboot/get-securebootuefi?view=windowsserver2022-ps
This commit is contained in:
Rafał Fitt
2022-09-16 23:22:37 +02:00
committed by GitHub
parent 26c7f95e30
commit 6a0598fa09

View File

@ -796,7 +796,13 @@ function CheckOSArchitecture
function CheckSecureBootState
{
$_secureBoot = Confirm-SecureBootUEFI
try {
$_secureBoot = Confirm-SecureBootUEFI
}
catch
{
$_secureBoot = $false
}
Log $_secureBoot
if($_secureBoot)
{