BlockHost exit when name is empty

This commit is contained in:
Yorick Barbanneau 2018-03-23 13:38:00 +01:00
parent 28853e6b0a
commit f3829001d4

View file

@ -20,7 +20,7 @@ function BlockHost {
Foreach ($line in Get-Content $params.file ){ BlockHost -params @{host=$line} }
}
if ( $params.ContainsKey('host') ) {
if ( $params.ContainsKey('host') -and $params.host -ne "" ) {
Write-Host -NoNewline "`t$($params.host) : "
try {
if ( ! $(IsHostAlreadyBlocked $HOST_FILE $params.host) ){