Skip to content

Commit 3f7b0a5

Browse files
authored
Update clear_dns.ps1
1 parent 23f3be6 commit 3f7b0a5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

clear_dns.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ Write-Host "PowerShell Game Enhancer`n"
33
# Infinte While-Loop that clears the user's DNS until they press Ctrl + c.
44
while($true)
55
{
6+
# Randomly generates a number (in seconds) for the DNS to be cleared again
7+
$delay = Get-Random 30,60,90,120,150,180;
68
# Runs the ipconfig flush dns command to flush the user's DNS
79
ipconfig /flushdns;
8-
# Adds a 2 minute delay to make the script flush the DNS every 2 minutes
9-
sleep 120
10+
# Clears the console window after the user's DNS is cleared to keep it clean.
11+
Clear-Host;
12+
13+
# Shows the user that their DNS has been flushed.
14+
Write-Host "`nPowerShell Game Enhancer`nCleared DNS...";
15+
16+
# Adds a random delay for the DNS to be cleared
17+
sleep $delay
1018
}

0 commit comments

Comments
 (0)