Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sandeep-sr
Created June 3, 2021 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandeep-sr/4c367d0d07aaed03625f559261968053 to your computer and use it in GitHub Desktop.
Save sandeep-sr/4c367d0d07aaed03625f559261968053 to your computer and use it in GitHub Desktop.
powershell - simple powershell operators we can increase the last digits in an IP
#Helps in increasing the IP based on the input
$IP="10.1.2.3"
$split=$IP.Split(".",4) | Select -Index 3
[int]$lastpart=$split
$ipnew=($ip.split(".",4)|select -index 0,1,2) -join "."
$add=$lastpart+25
$ip25th=$IPnew +"." +$add
Write-Output "$ip25th"
Output:
10.1.2.28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment