title: How to concatenate string variables with backslashes to create a UNC path in Powershell
body: <p>This seems like it should be a trivial thing.</p>
  
  <p>I am using Powershell v5.1 and I am trying to build a UNC path from 2 strings that represent a server and a share. Given that $Server hold "Distribution" and $Share holds "Publish"...</p>
  
  <pre><code> $Path = "\\" + $Server + "\" + $Share
  </code></pre>
  
  <p>The output I am getting for $Path is..</p>
  
  <pre><code>\\Distribution Publish\
  </code></pre>
  
  <p>I tried changing it to...</p>
  
  <pre><code>$Path = "//" + $Server + "/" + $Share
  </code></pre>
  
  <p>...as a test thinking the special character "\" was causing a problem, but then I still get the odd sequence where there is a space between server and share and the 2nd slash is at the end.</p>
  
  <pre><code>//Distribution Publish/
  </code></pre>
  
  <p>What am I missing?</p>