Sha256: 72b1a51a6044ac5dbb5e0f7cd5f72a22def73a47c24481063f7ed18ad3344dcf
Contents?: true
Size: 617 Bytes
Versions: 58
Compression:
Stored size: 617 Bytes
Contents
$ErrorAction = "Stop" # Find all of the NICsq $nics = [System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() # Save the IP addresses somewhere $nic_ip_addresses = @() foreach ($nic in $nics) { $nic_ip_addresses += $nic.GetIPProperties().UnicastAddresses | Where-Object { ($_.Address.IPAddressToString -ne "127.0.0.1") -and ($_.Address.IPAddressToString -ne "::1") } | Select -ExpandProperty Address } $nic_ip_addresses = $nic_ip_addresses | Sort-Object $_.AddressFamily $result = @{ ip_addresses = $nic_ip_addresses.IPAddressToString } Write-Output $(ConvertTo-Json $result)
Version data entries
58 entries across 54 versions & 6 rubygems