Today I write a quick tips Sometime, we need to know the external public IP address for a computer using Powershell. This can be done easily with a Web Service of ipify.org.
(Invoke-WebRequest -uri "https://api.ipify.org/").Content |
More
You can get more information about ipify.org here