Skip to content

Instantly share code, notes, and snippets.

@LawrenceHwang
Created December 30, 2016 00:02
Show Gist options
  • Save LawrenceHwang/542c009e7501f567bfc10a752110d549 to your computer and use it in GitHub Desktop.
Save LawrenceHwang/542c009e7501f567bfc10a752110d549 to your computer and use it in GitHub Desktop.
PowerShell one-liner to get machine's public IP
[ipaddress](((invoke-webrequest -Uri 'http://checkip.amazonaws.com/').Content | % {[char]$_}) -join '').trim()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment