Summary
In the bcdedit branch, the catch block sets the result to Failed, but the code immediately afterwards unconditionally overwrites it with the "Setting enabled ... Passed" result. A failed bcdedit /set is therefore reported as successful.
Affected code (HardeningKitty.psm1, commit 9fee160, v0.9.4)
- bcdedit /set call at line 2956
catch sets TestResult = "Failed" at lines 2958-2962
- unconditional
MessageSeverity/TestResult = "Passed" at lines 2967-2970
Impact
False-positive hardening confirmation for boot-configuration settings.
Recommendation
Skip the success path after a caught error (e.g. set a flag and Continue), and evaluate $LASTEXITCODE of bcdedit.
Summary
In the bcdedit branch, the
catchblock sets the result toFailed, but the code immediately afterwards unconditionally overwrites it with the "Setting enabled ... Passed" result. A failedbcdedit /setis therefore reported as successful.Affected code (
HardeningKitty.psm1, commit9fee160, v0.9.4)catchsetsTestResult = "Failed"at lines 2958-2962MessageSeverity/TestResult = "Passed"at lines 2967-2970Impact
False-positive hardening confirmation for boot-configuration settings.
Recommendation
Skip the success path after a caught error (e.g. set a flag and
Continue), and evaluate$LASTEXITCODEof bcdedit.