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:
+11
-1
@@ -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)"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user