Skip to content

Instantly share code, notes, and snippets.

@bielawb
Created March 8, 2016 19:12
Show Gist options
  • Select an option

  • Save bielawb/a90459e1e741b398bd56 to your computer and use it in GitHub Desktop.

Select an option

Save bielawb/a90459e1e741b398bd56 to your computer and use it in GitHub Desktop.
netsh dhcp server scope 192.168.7.0 show clients 1 | % {
if ($_ -match '(?n)(?<ip>\S+).*?(?<mac>([0-9a-f]{2}-){5}[0-9a-f]{2}).*?(?<name>\b\w+\.monad\.net)') {
$Matches.Remove(0)
$Matches.mac = $Matches.mac -replace '-', ':'
[PSCustomOBject]$Matches
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment