Gets the IP addresses in use on the local computer.
Get-IPAddress [<CommonParameters>]
Get-IPAddress [-V4] [-V6] [<CommonParameters>]
The .NET API for getting all the IP addresses in use on the current computer's network intefaces is pretty cumbersome. If all you care about is getting the IP addresses in use on the current computer, and you don't care where/how they're used, use this function.
If you do care about network interfaces, then you'll have to do it yourself using the System.Net.NetworkInformation.NetworkInterface class's GetAllNetworkInterfaces static method, e.g.
[Net.NetworkInformation.NetworkInterface]::GetNetworkInterfaces()
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
V4 | SwitchParameter | Return just IPv4 addresses. |
false | false | False |
V6 | SwitchParameter | Return just IPv6 addresses. |
false | false | False |
Get-IPAddress
Returns all the IP addresses in use on the local computer, IPv4 and IPv6.
Get-IPAddress -V4
Returns just the IPv4 addresses in use on the local computer.
Get-IPADdress -V6
Retruns just the IPv6 addresses in use on the local computer.