Technical Playground

Quick Powershell Command to Get External IP

Going through some notes and came across this quick script to get the external IP address of a Windows system running Powershell (I believe 2.0 and later.) This simply queries to get the public facing IP address and prints to screen / script / etc. Useful for quick remote commands if you have any level of commandline access but not a full GUI.

powershell -Command “(New-Object Net.WebClient).DownloadString(‘')”