Skip to content

Instantly share code, notes, and snippets.

@c22
c22 / GetAdaptersAddresses.ps1
Last active May 9, 2018 04:56
GetAdapterAddresses in PowerShell. Turned out NetworkGuid wasn't what I needed. Took me long enough to figure out that I couldn't bring myself to throw the code away.
$MethodDefinition = @'
[DllImport("iphlpapi.dll")]
public static extern uint GetAdaptersAddresses(uint Family, uint Flags, IntPtr Reserved, IntPtr pAdapterAddresses, ref uint pOutBufLen);
'@
$iphlpapi = Add-Type -MemberDefinition $MethodDefinition -Name 'IPHelper' -Namespace 'Pinvoke' -PassThru
@c22
c22 / keybase.md
Created September 10, 2019 00:32
keybase.md

Keybase proof

I hereby claim:

  • I am c22 on github.
  • I am c22 (https://keybase.io/c22) on keybase.
  • I have a public key ASB7fsJlaecAwUuLTIE1ltVD695TW6wToNkbfHqn2xvX_go

To claim this, I am signing this object: