From bbb0a590cfb6edc03ab2098733545b20a5243e0b Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 18 Jun 2024 20:35:42 +0200 Subject: [PATCH] Updated list-ip-addresses.ps1 --- scripts/list-ip-addresses.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/list-ip-addresses.ps1 b/scripts/list-ip-addresses.ps1 index eb67e246..784c0e56 100755 --- a/scripts/list-ip-addresses.ps1 +++ b/scripts/list-ip-addresses.ps1 @@ -13,20 +13,20 @@ #> function WriteLocalInterface($interface) { - $IPv4 = "" - $IPv6 = "" + $IPv4 = $IPv6 = $prefixLen = "" $addresses = Get-NetIPAddress foreach ($addr in $addresses) { if ($addr.InterfaceAlias -like "$($interface)*") { if ($addr.AddressFamily -eq "IPv4") { $IPv4 = $addr.IPAddress + $prefixLen = $addr.PrefixLength } else { $IPv6 = $addr.IPAddress } } } if ($IPv4 -ne "" -or $IPv6 -ne "") { - Write-Host "✅ Local $interface IP address $IPv4, $IPv6" + Write-Host "✅ Local $interface IP address $IPv4/$prefixLen, $IPv6" } }