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.

Leave a Reply

Your email address will not be published. Required fields are marked *