I have a series of 29 powershell scripts that execute sequentially. All of the information in each script is the same, but I have a string $buildID that needs to change between each version. Is it possible to do the following:
- Import the
$buildIDvariable from the previous script - Increment said variable by 1 (either numerically or alphabetically)
If $buildID was an int it would be easy. I tried to figure out #2 first so I attempted solving it using the below method:
$buildID=[int[]][char[]]'TestA'
$i = 0
$buildID[-1]++
[char[]]$buildID -join ""
$i++
echo $buildID
This technically works, $buildID will show "TestB" afterwards, but whenever I try to use the variable it shows the value is actually "88". Additionally, since I need more than 26 iterations the alphabet rolls over into special characters (which the system wouldn't accept) and numbers would roll over as well after 9.
Can someone either fix my method or show me an even better one?
intand only pass this value on if the text part is fixed anyway and only the version part changes?