How to handle backslash character in PowerShell -replace string operations? : <p>I am using -replace to change a path from source to destination. However I am not sure how to handle the \ character. For example:</p>

<pre><code>$source = "\\somedir"
$dest = "\\anotherdir"

$test = "\\somedir\somefile"

$destfile = $test -replace $source, $dest
</code></pre>

<p>After this operation, $destfile is set to </p>

<pre><code>"\\\anotherdir\somefile"
</code></pre>

<p>What is the correct way to do this to avoid the triple backslash in the result?</p>
