I am looking for a way to convert a string 1.2.0 to an int so that I could increment the last digit. Final result should be 1.2.1
$values = '1.2.0'
$after = $values.split('.');
$result = [int]$after;
# TODO increment the last decimal value, result should be 1.2.3
$result
This small snippet was a way to just figure out how to increment the last digit of my build number when I call the json string using tfs api.
I found a solution, I was trying to automate my TFS build version number to increment after every build during my build task. I will create variables for my build version numbers and follow this method.
I used these guides to create my script:
https://platform.deloitte.com.au/articles/how-to-automate-incrementing-project-build-numbers-in-vsts
http://devbraino.com/2017/09/25/auto-package-vsts-custom-build-task/