mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-22 21:58:42 +01:00
Updaate clear-dns-cache.ps1
This commit is contained in:
parent
546c436b3e
commit
436a650f2f
@ -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."
|
||||
|
Loading…
Reference in New Issue
Block a user