Monday, August 14, 2017

How Do I find my IP Address in powershell?

Just need to open a PowerShell console and write:
(Get-NetIPAddress | ?{ $_.AddressFamily -eq "IPv4"  -and !($_.IPAddress -match "169") -and !($_.IPadd
ress -match "127") }).IPAddress
Of course, if you do it like this
Get-NetIPAddress | ?{ $_.AddressFamily -eq "IPv4"  -and !($_.IPAddress -match "169") -and !($_.IPaddress -match "127") }
You would get an object that you can pipe with others cmdlet like ConvertTo-CSV /json/ etc. If you have doubts or question don't hesitate in asking or leaving your comment.

0 comments:

Post a Comment