From bc841b15ddccdd600eea06279336c5bbf460b421 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 2 Feb 2018 09:57:47 +0100 Subject: [PATCH] Reworked output fot block_shitty_ip () --- cleanW10.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cleanW10.ps1 b/cleanW10.ps1 index 6bbdf82..3425d08 100644 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -42,7 +42,7 @@ function is_host_present { function block_shitty_ip { param($ip) Write-Host -ForegroundColor white -NoNewline "Blacklist IP $ip : " - if ( Get-NetFirewallRule -Name Blacklist_$ip) { + if ( Get-NetFirewallRule -Name Blacklist_$ip -ErrorAction SilentlyContinue) { Write-Host -ForegroundColor Yellow "Already blacklisted" return } @@ -54,6 +54,7 @@ function block_shitty_ip { Write-Host -Nonewline -ForegroundColor Red " Error " return } + Write-Host -ForegroundColor Green " Done" } }