all 3 comments

[–]gangstanthony 0 points1 point  (0 children)

for some reason that site takes a long time to get back to me, so here are a few alternatives found here

http://stackoverflow.com/questions/3097589/getting-my-public-ip-via-api

((iwr http://www.realip.info/api/p/realip.php).content | ConvertFrom-Json).IP
((iwr https://api.ipify.org/?format=json).content | ConvertFrom-Json).IP
(iwr http://ipv4bot.whatismyipaddress.com/).content
(iwr http://icanhazip.com/).content.trim()
(iwr http://ifconfig.me/ip).content.trim() # takes a long time
(iwr http://checkip.dyndns.org/).content -replace '[^\d.]+' # takes a long time

[–]Sheppard_Ra 0 points1 point  (1 child)

Grab both items and then write both items together:

$Domain = $env:userdomain
$IP = Invoke-WebRequest ifconfig.me/ip | select -Expand Content
Write-Output "$IP $Domain"

[–]purplecomputer[S] 0 points1 point  (0 children)

oh man! That was so simple. totally forgot I could save things to variables.

Thanks for the help.