Get-PrimaryIPAddress by halr9000 28 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1403"></script>download | new post
As seen on http://halr9000.com/article/829#comments. Needs some prettying up with help and stuff but should work well.
- [system.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() |
- Where-Object { $_.GetIPProperties().GatewayAddresses } |
- ForEach-Object {
- $_.GetIPProperties().UnicastAddresses| ForEach-Object {
- $_.Address.IPAddressToString
- }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository