Files
QEMU-S5L8950X/windows/QemuA6Ude/enable-test-mode.ps1
T

30 lines
993 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#Requires -RunAsAdministrator
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
$logPath = Join-Path $PSScriptRoot 'enable-test-mode.log'
$secureBoot = $null
try {
$secureBoot = Confirm-SecureBootUEFI
} catch {
Write-Verbose "État Secure Boot non lisible : $($_.Exception.Message)"
}
$bcdOutput = & bcdedit.exe /set testsigning on 2>&1
$bcdOutput | Out-File -LiteralPath $logPath -Encoding utf8 -Force
if ($LASTEXITCODE -ne 0) {
if ($secureBoot -eq $true) {
throw 'Secure Boot bloque le mode de signature test. Il faut le désactiver dans lUEFI avant de recommencer.'
}
throw "Impossible dactiver le mode de signature test ($LASTEXITCODE)."
}
Write-Host 'Mode de signature test activé dans le BCD.'
Write-Host 'Un redémarrage de Windows est requis avant le chargement de QemuA6Ude.sys.'
Add-Content -LiteralPath $logPath -Encoding utf8 -Value @(
'Mode de signature test activé dans le BCD.',
'Un redémarrage de Windows est requis.'
)