I have 3 environments to work with, and need to choose a value based on which environment I'm in. I have a dynamic variable $environment
that could be either development, test, or production. I want to also have other variables:
$development
$test
$production
that have values to be used based on which environment I'm working in.
Is there some way of calling $($environment) and using the result of the environment variable as another variable? To clarify:
$abc = "prod" $prod = "production-value"
I want to call something like $($abc) and have that return "production-value"
A similar question was asked here but for Ruby; is there a way to do this in Powershell?