Updated clear-dns-cache.ps1

This commit is contained in:
Markus Fleschutz 2025-06-23 09:58:34 +02:00
parent 04f833531e
commit 166aabba5b

View File

@ -2,10 +2,10 @@
.SYNOPSIS .SYNOPSIS
Clears the DNS cache Clears the DNS cache
.DESCRIPTION .DESCRIPTION
This PowerShell script clears the DNS client cache of the local computer. This PowerShell script empties the DNS client cache of the local computer.
.EXAMPLE .EXAMPLE
PS> ./clear-dns-cache.ps1 PS> ./clear-dns-cache.ps1
Cleared DNS cache in 1s. DNS cache cleared in 1s.
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -18,9 +18,9 @@ try {
Clear-DnsClientCache Clear-DnsClientCache
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"Cleared DNS cache in $($elapsed)s." "DNS cache cleared in $($elapsed)s."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0])"
exit 1 exit 1
} }