Hi,
To remove the last octet of an IP address I put together the following:
$array = New-Object System.Collections.ArrayList
$ipaddress.Split(".") | ForEach-Object {$array.Add($_)} | Out-Null
$array.Remove($array[3])
$ipaddress = ($array -join ".") + "."
However, I`m sure there are other, more effective ways to do this, i.e. using regex to "remove the third group of digits after the 3rd dot".
Any suggestions around this?
I.e. 192.168.0.10 should be 192.168.0.