Create an incrementing variable from 2 variables in PowerShell

You’re looking for variable indirection, i.e. the ability to refer to a variable indirectly, by a name stored in another variable or returned from an expression. Note, however, that there are usually superior alternatives, such as using arrays or hashtables as multi-value containers – see this answer for an example. If you do need to … Read more