I would like to get from the user 2 variables: $ip1 $ip2
and run a loop between their IP address. for example:
$ip1 = 192.168.1.10
$ip2 = 192.168.1.200
The script assume its a class C, the i need to strip everything and get 3 variables:
$IP = 192.168.1.
$FirstIP = 10
$LastIp = 200
At first i thought about substring ($ip.length - 3), that could give me XXX, .XX, X.X (Where X is a number) Depends on the last Octat.. Any idea how can it be done nicely?
'192.168.1.100' -replace '\.\d+$'.(\.) and a digit (\d) one or more times (+) followed by end of string ($)