I am wondering if it is possible to reference a variable in powershell by concatonating two or more pieces of data. See example below...
$v0 = "My Var"
$v1 = "My Var2"
$suffix = 0
#THESE EXAMPLES BELOW (ALTHOUGH WRONG) WILL ILLUSTRATE WHAT WE ARE TRYING TO DO.
Write-Host $(v($suffix)) #ERROR
Write-Host $(v$suffix) #ERROR
Write-Host v$suffix # "v0"
I would like this script to output "My Var". I do not think this is possible since Powershell is using .NET which is not a dynamic language. Any ideas if this is possible?