title: How do I replace spaces with %20 in PowerShell?
body: <p>I'm creating a PowerShell script that will assemble an HTTP path from user input. The output has to convert any spaces in the user input to the product specific codes, "%2F".</p>
  
  <p>Here's a sample of the source and the output:</p>
  
  <p>The site URL can be a constant, though a variable would be a better approach for reuse, as used in the program is: /http:%2F%2SPServer/Projects/"</p>
  
  <pre><code>$Company="Company"
  $Product="Product"
  $Project="The new project"
  $SitePath="$SiteUrl/$Company/$Product/$Project"
  </code></pre>
  
  <p>As output I need:</p>
  
  <pre><code>'/http:%2F%2FSPServer%2FProjects%2FCompany%2FProductF2FThe%2Fnew%2Fproject'
  </code></pre>