Created
May 29, 2025 17:07
-
-
Save victorgare/de0cf123b51373dc21f3ea3496b14370 to your computer and use it in GitHub Desktop.
Unblock TS blacklist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$hostsPath = "$env:SystemRoot\System32\drivers\etc\hosts" | |
$entry = "0.0.0.0 blacklist2.teamspeak.com" | |
# Verifica se a linha já existe | |
$exists = Select-String -Path $hostsPath -Pattern [regex]::Escape($entry) -Quiet | |
if (-not $exists) { | |
try { | |
Add-Content -Path $hostsPath -Value $entry | |
Write-Host "Entrada adicionada com sucesso ao arquivo hosts." -ForegroundColor Green | |
} catch { | |
Write-Host "Erro ao tentar adicionar a entrada. Execute como administrador." -ForegroundColor Red | |
} | |
} else { | |
Write-Host "A entrada já existe no arquivo hosts." -ForegroundColor Yellow | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment