Updaate clear-dns-cache.ps1

This commit is contained in:
Markus Fleschutz 2022-05-09 16:20:18 +02:00
parent 546c436b3e
commit 436a650f2f

View File

@ -2,7 +2,7 @@
.SYNOPSIS
Clears the DNS cache
.DESCRIPTION
This PowerShell script clears the DNS cache of the local computer.
This PowerShell script clears the DNS client cache of the local computer.
.EXAMPLE
PS> ./clear-dns-cache
.LINK
@ -14,8 +14,7 @@
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
$null = (ipconfig /flushdns)
if ($lastExitCode -ne "0") { throw "'ipconfig /flushdns' failed with exit code $lastExitCode" }
Clear-DnsClientCache
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ cleared DNS cache in $Elapsed ms."