Windows PowerShell is a powerful tool that is developed by Microsoft for purposes of task automation and configuration management. This is based on the .NET framework and it includes a command-line shell and a scripting language. Windows PowerShell is designed especially for the system administrators. If you are a windows administrator and if you know PowerShell very well and you can simplify and automate tedious and repetitive tasks by creating scripts and combining multiple commands together. Using PowerShell you can easily manage your computers from the command line. PowerShell providers let you access data stores, such as the registry and system certificate stores, also you can easily access the file system. Also using PowerShell we can troubleshoot Network related problems, In windows to troubleshoot network-related problems we usually use Command prompt. Using Command prompt we can find the IP address, Public IP, Ping, Tracert, etc., Microsoft added PowerShell in windows 7, PowerShell is more powerful command-line shell and scripting language than command prompt, It uses different commands Known as cmdlets in PowerShell.
Like command prompt we can use PowerShell for Network Troubleshooting, In this article, we are going to see how to check Public IP address using PowerShell. Public IP address of a system is the IP address that is used to communicate outside the network. Public IP address is basically assigned by the ISP (Internet Service Provider). The easiest way to find Public IP address is to use a dedicated website to doing that. These websites are using their own tools to locate your IP address. Or simply Type findMyIp in google search engine, you will get your Public IP address. This article will Guide to Find Public IP address Using PowerShell
Find Public IP address Using PowerShell:
Open PowerShell Type the Below mentioned cmdlet and hit enter
(Invoke-WebRequest -uri " http://ipinfo.io/ip/").Content
About this command: Invoke-WebRequest is the cmdlet which sends HTTP and HTTPs requests to a web page or web service, and it gets the response and returns collections of links, images, and other significant HTML elements. This cmdlet was introduced in PowerShell 3.0, make sure you are using higher version of PowerShell. There are many sites to check the Public IP address, but use only the site which shows only IP address in the form of plain-text.
More alternative sites:
- http://ifconfig.me/ip
- http://icanhazip.com
- http://ident.me
- http://smart-ip.net/myip
- “https://api.ipify.org/