Last active
November 3, 2015 20:53
-
-
Save mockmyberet/4b873f87c2f2f7bdc08f to your computer and use it in GitHub Desktop.
Adding a type property to fix System.Net.IPAddress bytes address style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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