I am using powershell script to set some environment variable -
$env:FACTER_Variable_Name = $Variable_Value
FACTER is intended for use in puppet scenarios.
My problem is the variable name and variable value are dynamic and read from a text file.
I'm trying to use
$env:FACTER_$Variable_Name = $Variable_Value
But $ is not an acceptable syntax. When I enclose it in double quotation marks, the value of the variable will not be passed. Any suggestion on how to use it dynamically.
Thanks at Advance
source share