What you're seeing is the Execution Policy in effect. There are different levels of trust, and your current policy doesn't allow unsigned scripts.
I can't provide a signed script because of two reasons:
1. Not a professional dev, and signer certs from a trusted Certificate Authority are not cheap (it's designed that way to prevent casual hacking). Other folks who are devs do enough work to justify the cert's cost. Doing this for free.
2. While I could make my own self-signed cert and sign my scripts, you would have to import the cert into your Windows. That doesn't make the process any easier.
For the security conscious, the script is not obfuscated and all the Secure Boot files are accessed from Windows itself or the MS Secure Boot GitHub.
When you run the batch script, it does the same "
powershell -ExecutionPolicy Bypass" or
-ep bypass, on the command line.
Code:
@echo off
where pwsh >nul 2>nul
if %errorlevel% equ 0 (
pwsh -nop -ep bypass -noexit -f "%~dp0\Check_UEFI-CA2023.ps1" %*
) else (
powershell -nop -ep bypass -noexit -f "%~dp0\Check_UEFI-CA2023.ps1" %*
)
You can pass the batch file the same arguments, as the PS script.
Code:
Check-UEFI.bat -Verbose -BootMedia