diff --git a/utils/test zapret.ps1 b/utils/test zapret.ps1 index 70b9f63..0d21399 100644 --- a/utils/test zapret.ps1 +++ b/utils/test zapret.ps1 @@ -838,13 +838,18 @@ try { Write-Host "" Write-Host "=== ANALYTICS ===" -ForegroundColor Cyan + $maxConfigLen = ($analytics.Keys | ForEach-Object { $_.Length } | Measure-Object -Maximum).Maximum foreach ($config in $analytics.Keys) { $a = $analytics[$config] + $configPadded = $config.PadRight($maxConfigLen) if ($a.ContainsKey('PingOK')) { - Write-Host "$config : HTTP OK: $($a.OK), ERR: $($a.ERROR), UNSUP: $($a.UNSUP), Ping OK: $($a.PingOK), Fail: $($a.PingFail)" -ForegroundColor Yellow + $line = "{0} : HTTP OK: {1,3}, ERR: {2,3}, UNSUP: {3,3}, Ping OK: {4,3}, Fail: {5,3}" -f ` + $configPadded, $a.OK, $a.ERROR, $a.UNSUP, $a.PingOK, $a.PingFail } else { - Write-Host "$config : OK: $($a.OK), FAIL: $($a.FAIL), UNSUP: $($a.UNSUPPORTED), BLOCKED: $($a.LIKELY_BLOCKED)" -ForegroundColor Yellow + $line = "{0} : OK: {1,3}, FAIL: {2,3}, UNSUP: {3,3}, BLOCKED: {4,3}" -f ` + $configPadded, $a.OK, $a.FAIL, $a.UNSUPPORTED, $a.LIKELY_BLOCKED } + Write-Host $line -ForegroundColor Yellow } # Determine best strategy @@ -916,13 +921,18 @@ try { # Add analytics Add-Content $resultFile "=== ANALYTICS ===" + $maxConfigLen = ($analytics.Keys | ForEach-Object { $_.Length } | Measure-Object -Maximum).Maximum foreach ($config in $analytics.Keys) { $a = $analytics[$config] + $configPadded = $config.PadRight($maxConfigLen) if ($a.ContainsKey('PingOK')) { - Add-Content $resultFile "$config : HTTP OK: $($a.OK), ERR: $($a.ERROR), UNSUP: $($a.UNSUP), Ping OK: $($a.PingOK), Fail: $($a.PingFail)" + $line = "{0} : HTTP OK: {1,3}, ERR: {2,3}, UNSUP: {3,3}, Ping OK: {4,3}, Fail: {5,3}" -f ` + $configPadded, $a.OK, $a.ERROR, $a.UNSUP, $a.PingOK, $a.PingFail } else { - Add-Content $resultFile "$config : OK: $($a.OK), FAIL: $($a.FAIL), UNSUP: $($a.UNSUPPORTED), BLOCKED: $($a.LIKELY_BLOCKED)" + $line = "{0} : OK: {1,3}, FAIL: {2,3}, UNSUP: {3,3}, BLOCKED: {4,3}" -f ` + $configPadded, $a.OK, $a.FAIL, $a.UNSUPPORTED, $a.LIKELY_BLOCKED } + Add-Content $resultFile $line } Add-Content $resultFile "Best strategy: $bestConfig"