Skip to content

Instantly share code, notes, and snippets.

@tonyyates
Created March 27, 2024 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyyates/8e10ae9040ad238aa90e781cf022f3da to your computer and use it in GitHub Desktop.
Save tonyyates/8e10ae9040ad238aa90e781cf022f3da to your computer and use it in GitHub Desktop.
PowerShell Script select only the first MAC address, append a timestamp and append to a file every 5 seconds
# PowerShell Script select only the first MAC address, append a timestamp
# and append to a file every 5 seconds
while (1)
{
$arpTable = $(arp -a) | select -Skip 3 | Select -first 1
$arpTable = $arpTable + $(Get-Date)
Out-File -Append -FilePath .\captured-mac.txt -InputObject $arpTable
Start-Sleep -Seconds 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment