Created
January 28, 2016 05:31
-
-
Save motowilliams/f8eea672dd304d8464a5 to your computer and use it in GitHub Desktop.
Looks up public IP address and gets the public host name
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
$ipaddress = Invoke-RestMethod -Uri "https://api.ipify.org" | |
$dnsName = Resolve-DnsName -Name $ipaddress | |
$nameHost = $dnsName.NameHost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment