Skip to content

list-network-neighbors

Lists the (cached) network neighbors

#Requires -Version 5.1

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
} catch {
throw
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.