fix(ux): improve failure messaging with success rate

Shows clear success rate when some exclusions fail (e.g., "Only 2/3
exclusions added (67%)"). Helps users understand that performance
benefit may be reduced when not all paths are excluded.

- Calculates success rate as percentage
- Shows "X/Y added (Z%)" format for clarity
- Warns that performance benefit may be reduced
- Better visibility of partial failures

Improves user awareness of partial installation issues.
This commit is contained in:
e-cesar9
2026-02-12 17:30:17 +01:00
parent b46a5f0247
commit 63e0348963
+11 -1
View File
@@ -574,7 +574,17 @@ if (-not $checkResult.DefenderEnabled) {
if ($result.Failed.Count -gt 0) {
Write-Host ""
Write-Warn "Some exclusions failed:"
# Calculate and show success rate
$totalPaths = $result.Added.Count + $result.Failed.Count
if ($totalPaths -gt 0) {
$successRate = [math]::Round(($result.Added.Count / $totalPaths) * 100)
Write-Warn "⚠️ Only $($result.Added.Count)/$totalPaths exclusions added ($successRate%)"
Write-Host "Performance benefit may be reduced."
Write-Host ""
}
Write-Warn "Failed exclusions:"
foreach ($failure in $result.Failed) {
Write-Warn " $($failure.Path): $($failure.Error)"
}