mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-17 07:28:18 +02:00
Updaate clear-dns-cache.ps1
This commit is contained in:
parent
546c436b3e
commit
436a650f2f
@ -2,7 +2,7 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Clears the DNS cache
|
Clears the DNS cache
|
||||||
.DESCRIPTION
|
.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
|
.EXAMPLE
|
||||||
PS> ./clear-dns-cache
|
PS> ./clear-dns-cache
|
||||||
.LINK
|
.LINK
|
||||||
@ -14,8 +14,7 @@
|
|||||||
try {
|
try {
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
$null = (ipconfig /flushdns)
|
Clear-DnsClientCache
|
||||||
if ($lastExitCode -ne "0") { throw "'ipconfig /flushdns' failed with exit code $lastExitCode" }
|
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ cleared DNS cache in $Elapsed ms."
|
"✔️ cleared DNS cache in $Elapsed ms."
|
||||||
|
Loading…
Reference in New Issue
Block a user