Skip to content

Instantly share code, notes, and snippets.

@MertSenel
Last active May 23, 2020 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MertSenel/60c3a34ad91ec64e0a94410ca5f849b6 to your computer and use it in GitHub Desktop.
Save MertSenel/60c3a34ad91ec64e0a94410ca5f849b6 to your computer and use it in GitHub Desktop.
Get your Public IP address returned with this function
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