title: Variable expansion and escaped characters
body: <p>In PowerShell, you can expand variables within strings as shown below:</p>
  
  <pre><code>$myvar = "hello"
  $myvar1 = "$myvar`world" #without the `, powershell would look for a variable called $myvarworld
  Write-Host $myvar1 #prints helloworld
  </code></pre>
  
  <p>The problem I am having is with escaped characters like <code>n</code>r etc, as shown below:</p>
  
  <pre><code>$myvar3 = "$myvar`albert"
  Write-Host $myvar3 #prints hellolbert as `a is an alert 
  </code></pre>
  
  <p>also the following doesnt work:</p>
  
  <pre><code>$myvar2 = "$myvar`frank" #doesnt work
  Write-Host $myvar2 #prints hellorank.
  </code></pre>
  
  <p>Question:
  How do I combine the strings without worrying about escaped characters when I am using the automatic variable expansion featurie?
  Or do I have to do it only this way:</p>
  
  <pre><code>$myvar = "hello"
  $myvar1 = "$myvar"+"world" #using +
  Write-Host $myvar1
  $myvar2 = "$myvar"+"frank" #using +
  </code></pre>