I’ve used this forum in the past to find a ton of answers but haven’t had any luck finding what I’m trying to do so this is my first post. I’m OK with Powershell but no where near a heavy hitter.
I have a text file that has some network information in it on different lines. I’m needing to pull the IP information from one specific line. The line I need looks like “First 3 Octets of Network Address=192.168.160.”
There are two parts to this:
1.) I need to pull out just the “192.168.160.” part of that line and put it into a variable.
2.) I need to pull out just the “192.168.160.” part of that line, increment the 3rd octet by 1 (making it .161) and put it into another variable.
I’ve found bits and pieces of what I’m trying to do online but haven’t had luck trying to combine it.
What about using $start = indexof(“=”) with substring($start+1,start+12), then you can split the IP by ., then assign the third member of the array to an int, which you an increase by one and then build a new variable with [0].[1].$int ?