 <p>You can use the ExpandString function, <a href="http://blogs.microsoft.co.il/scriptfanatic/2011/01/02/expanding-strings-and-environment-variables-in-powershell/" rel="nofollow">like this</a>:</p> <pre><code>$ExecutionContext.InvokeCommand.ExpandString($TemplVal) </code></pre> <p>(assuming $TemplVal has the template string).</p>