Simple enough question but I cant figure this out. I have a string with a variable name in it, and I want to replace the variable with its value. i.e.
PS > $test = "Hello `$name"
PS > $test
Hello $name
PS > $name = "Tizz"
PS > $name
Tizz
I cannot change the values of $test or $name. I need a new variable with the replaced value (I want $testTizz to have the string value "Hello Tizz"). So logically I tried this and failed
PS > $testTizz = $test -replace "`$name", $name
PS > $testTizz
Hello $name