posted 26/07/09

Get-MyInternetIP and Get-MyInternetCity

By Fredrik Wall

image

 

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:

  1. My Internet IP information
  2. Create Lab AD Functions (Updated)
  3. Ping-Status function
  4. How to backup Twitter Friends using PowerShell and Excel
  5. How to Backup Twitter Friends with PowerShell and Excel Automatically


Comments
walle75 (Fredrik Wall) July 26th, 2009 (2:12 pm)
comment

2 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8

nem515 (nem) July 26th, 2009 (2:18 pm)
comment

RT @walle752 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8

nem515 (nem) July 26th, 2009 (2:19 pm)
comment

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

nem WordPress v1.1.3 July 26th, 2009 (2:19 pm)
comment

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

Fredrik Wall WordPress v1.1.3 July 26th, 2009 (3:12 pm)
comment

2 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8

nem WordPress v1.1.3 July 26th, 2009 (3:18 pm)
comment

RT @walle752 of my #PowerShell functions, Get-MyInternetIP and Get-MyInternetCity, http://tinyurl.com/nstuf8

Jeffrey Snover Windows 7 Internet Explorer 7.0 July 26th, 2009 (5:07 pm)
comment

Sweet!

jps

Add Comment

Name (Required)

E-mail (Required)

Website

Comment (Required)