Last active
August 29, 2015 14:12
-
-
Save lazywinadmin/ad42bc981b3179da0307 to your computer and use it in GitHub Desktop.
Smart way to convert string to ipaddress data
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
"::1" -as [ipaddress] | fl * -Force | |
IPAddressToString : ::1 | |
Address : | |
AddressFamily : InterNetworkV6 | |
ScopeId : 0 | |
IsIPv6Multicast : False | |
IsIPv6LinkLocal : False | |
IsIPv6SiteLocal : False | |
IsIPv6Teredo : False | |
IsIPv4MappedToIPv6 : False | |
"2001:0db8:0000:0000:0000:ff00:0042:8329" -as [ipaddress] | fl * -Force | |
IPAddressToString : 2001:db8::ff00:42:8329 | |
Address : | |
AddressFamily : InterNetworkV6 | |
ScopeId : 0 | |
IsIPv6Multicast : False | |
IsIPv6LinkLocal : False | |
IsIPv6SiteLocal : False | |
IsIPv6Teredo : False | |
IsIPv4MappedToIPv6 : False | |
"192.168.1.1" -as [ipaddress] | fl * -Force | |
IPAddressToString : 192.168.1.1 | |
Address : 16885952 | |
AddressFamily : InterNetwork | |
ScopeId : | |
IsIPv6Multicast : False | |
IsIPv6LinkLocal : False | |
IsIPv6SiteLocal : False | |
IsIPv6Teredo : False | |
IsIPv4MappedToIPv6 : False | |
"192.168.1.1" -as [ipaddress] | Get-Member | |
TypeName: System.Net.IPAddress | |
Name MemberType Definition | |
---- ---------- ---------- | |
Equals Method bool Equals(System.Object comparand) | |
GetAddressBytes Method byte[] GetAddressBytes() | |
GetHashCode Method int GetHashCode() | |
GetType Method type GetType() | |
MapToIPv4 Method ipaddress MapToIPv4() | |
MapToIPv6 Method ipaddress MapToIPv6() | |
ToString Method string ToString() | |
Address Property long Address {get;set;} | |
AddressFamily Property System.Net.Sockets.AddressFamily AddressFamily {get;} | |
IsIPv4MappedToIPv6 Property bool IsIPv4MappedToIPv6 {get;} | |
IsIPv6LinkLocal Property bool IsIPv6LinkLocal {get;} | |
IsIPv6Multicast Property bool IsIPv6Multicast {get;} | |
IsIPv6SiteLocal Property bool IsIPv6SiteLocal {get;} | |
IsIPv6Teredo Property bool IsIPv6Teredo {get;} | |
ScopeId Property long ScopeId {get;set;} | |
IPAddressToString ScriptProperty System.Object IPAddressToString {get=$this.Tostring();} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment