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" } }