title: Quoting -replace & variables
body: <p>This is in response to my previous question:</p>
  
  <p><a href="https://stackoverflow.com/questions/9401713/powershell-replace-regex-and-dollar-sign-woes">PowerShell: -replace, regex and ($) dollar sign woes</a></p>
  
  <p>My question is: why do these 2 lines of code have different output:</p>
  
  <pre><code>'abc' -replace 'a(\w)', '$1'
  'abc' -replace 'a(\w)', "$1"
  </code></pre>
  
  <p>AND according to the 2 articles below, why doesn't the variable '$1' in single quotes get used as a literal string? Everything in single quotes should be treated as a literal text string, right?</p>
  
  <p><a href="http://www.computerperformance.co.uk/powershell/powershell_quotes.htm" rel="noreferrer">http://www.computerperformance.co.uk/powershell/powershell_quotes.htm</a><br>
  <a href="http://blogs.msdn.com/b/powershell/archive/2006/07/15/variable-expansion-in-strings-and-herestrings.aspx" rel="noreferrer">http://blogs.msdn.com/b/powershell/archive/2006/07/15/variable-expansion-in-strings-and-herestrings.aspx</a></p>