Sorting an array of IP addresses is one of those things that’s not quite as clean and simple as would be nice.

Fortunately, the process can be simplified greatly by converting an IP address to decimal for the sort operation. To do this, I like to use ConvertTo-DecimalIP from my NetShell module (or my collection of subnet maths functions).

Short and simple.

You must be logged in to leave a reply.