Skip to content

Instantly share code, notes, and snippets.

@taoski
taoski / cidrToIpRange.ps1
Last active March 20, 2024 19:03 — forked from davidjenni/cidrToIpRange.ps1
CIDR to IP range conversion using PowerShell and ping range of IP addresses
# calculate IP address range from CIDR notation
# https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
function cidrToIpRange {
param (
[string] $cidrNotation
)
$addr, $maskLength = $cidrNotation -split '/'
[int]$maskLen = 0