mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-27 09:08:58 +01:00
Add list-network-neighbors.ps1
This commit is contained in:
parent
9a9d83dfc8
commit
adfc40c2cf
25
scripts/list-network-neighbors.ps1
Normal file
25
scripts/list-network-neighbors.ps1
Normal file
@ -0,0 +1,25 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the (cached) network neighborspwd
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all cached network neighbors of the local computer.
|
||||
.EXAMPLE
|
||||
PS> ./list-network-neighbors.ps1
|
||||
|
||||
Name InterfaceAlias IPAddress LinkLayerAddress State
|
||||
---- -------------- --------- ---------------- -----
|
||||
<<>8:8:8<?;55;=55; Ethernet 224.0.0.251 01-00-5E-00-00-FB Permanent
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Get-NetNeighbor -includeAllCompartments | Format-Table -property Name,InterfaceAlias,IPAddress,LinkLayerAddress,State -autoSize
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user