Skip to content

Instantly share code, notes, and snippets.

@programmeruser2
Last active July 5, 2021 13:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save programmeruser2/45f3cbc2eedb79dad6809b9bb50510d3 to your computer and use it in GitHub Desktop.
Save programmeruser2/45f3cbc2eedb79dad6809b9bb50510d3 to your computer and use it in GitHub Desktop.
Get the Wi-Fi or Ethernet IP Address
(Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.AddressState -eq "Preferred" -and ($_.InterfaceAlias -eq "Wi-Fi" -or $_.InterfaceAlias -eq "Ethernet")}).IPAddress
@programmeruser2
Copy link
Author

iwr https://gist.githubusercontent.com/programmeruser2/45f3cbc2eedb79dad6809b9bb50510d3/raw/b491f7b16992776488467f9675800b993418657a/ip.ps1 | iex

@ShehzadBOB
Copy link

iwr https://gist.githubusercontent.com/programmeruser2/45f3cbc2eedb79dad6809b9bb50510d3/raw/b491f7b16992776488467f9675800b993418657a/ip.ps1 | iex

@programmeruser2
Copy link
Author

programmeruser2 commented Jul 5, 2021

iwr https://gist.githubusercontent.com/programmeruser2/45f3cbc2eedb79dad6809b9bb50510d3/raw/b491f7b16992776488467f9675800b993418657a/ip.ps1 | iex

What?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment