posted
26/07/09
Get-MyInternetIP and Get-MyInternetCity
By Fredrik Wall
Two very simple function that’s get my IP address and City on the internet.
Function Get-MyInternetIP { if ($WebClient -eq $null) {$Global:WebClient=new-object System.Net.WebClient } $url="http://ip-address.domaintools.com/myip.xml" $myInternetIP=([xml]($WebClient.DownloadString($url))).dnstools.ip_address $myInternetIP } Function Get-MyInternetCity { if ($WebClient -eq $null) {$Global:WebClient=new-object System.Net.WebClient } $url="http://ip-address.domaintools.com/myip.xml" $myInternetCity=([xml]($WebClient.DownloadString($url))).dnstools.city $myInternetCity }
Related posts:

Comments
2 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8
RT @walle752 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8
RT – XML Goodness @walle75 2 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8
RT – XML Goodness @walle75 2 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8
2 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8
RT @walle752 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8
Sweet!
jps