PowerShell: get your external IP address

Needed this in a script to automatically add a firewall rule to my Azure SQL server:

 

$externalIP = (New-Object net.webclient).downloadstring("http://checkip.dyndns.com") -replace "[^\d\.]"

No Comments