Use the Scriptblock `{$_ -as [version]} to sort an array of IPv4 addresses.
Running these commands should result in a sorted list.
$ips = @("192.168.5.25","192.168.5.1","192.168.6.18","192.168.5.10")
$ips | Sort-Object {$_ -as [version]}
Results:
192.168.5.1
192.168.5.10
192.168.5.25
192.168.6.18