Skip to content

Instantly share code, notes, and snippets.

@mockmyberet
Last active November 3, 2015 20:53
Show Gist options
  • Save mockmyberet/4b873f87c2f2f7bdc08f to your computer and use it in GitHub Desktop.
Save mockmyberet/4b873f87c2f2f7bdc08f to your computer and use it in GitHub Desktop.
Adding a type property to fix System.Net.IPAddress bytes address style.
<?xml version="1.0" encoding="utf-8" ?>
<Types>
<Type>
<Name>System.Net.IPAddress</Name>
<Members>
<ScriptProperty>
<Name>BigEndianAddress</Name>
<GetScriptBlock>
$bytes=$this.GetAddressBytes()
[array]::Reverse($bytes)
[BitConverter]::ToUInt32($bytes,0)
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
</Types>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment