Skip to content

clear-dns-cache

Clears the DNS cache

#Requires -Version 5.1

try {
	$stopWatch = [system.diagnostics.stopwatch]::startNew()

	Clear-DnsClientCache

	[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
	"✅ DNS cache cleared in $($elapsed)s."
	exit 0
} catch {
throw
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.