Last active
May 23, 2020 08:19
-
-
Save MertSenel/60c3a34ad91ec64e0a94410ca5f849b6 to your computer and use it in GitHub Desktop.
Get your Public IP address returned with this function
This file contains 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
function Get-PublicIPAddress { | |
[CmdletBinding()] | |
$OriginalPref = $ProgressPreference # Default is 'Continue' | |
$ProgressPreference = "SilentlyContinue" | |
(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content | |
$ProgressPreference = $OriginalPref | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment