Skip to content

List-NetworkNeighbors

Lists the (cached) network neighbors

try {
	if ($IsLinux) {
		& ip neigh | grep REACHABLE
	} elseif ($IsMacOS) {
		& ip neigh | grep REACHABLE
	} else {
		Get-NetNeighbor -includeAllCompartments -state Permanent,Reachable | Format-Table -property @{e='IPAddress';width=38},@{e='InterfaceAlias';width=14},@{e='LinkLayerAddress';width=19},@{e='State';width=12} 
	}
	exit 0 # success
} catch {
	"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
	exit 1
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.