title: Return value of environment variable with powershell
body: <p>I have the name of an environment variable in a variable and I want to get the value. How do I do that? I've tried:</p>
  
  <pre><code>PS C:\Users\Joe&gt; $v="USERDOMAIN"
  PS C:\Users\Joe&gt; "$env:$v"
  At line:1 char:2
  + "$env:$v"
  +  ~~~~~
  Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to
  delimit the name.
      + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive
  
  PS C:\Users\Joe&gt; "$env:$($v)"
  At line:1 char:2
  + "$env:$($v)"
  +  ~~~~~
  Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to
  delimit the name.
      + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive
  </code></pre>