Spaces in filepath
<p>Working on a simple script to pull workstation names from a <code>.csv</code> file then open a folder location on that workstation. I keep running into trouble on how to get PowerShell to not split the filepath. So far I have tried:</p>

<p>Single quotes: <code>'\\$results\c$\direc\Desktop\Start Menu\Programs\Startup'</code></p>

<p>Regular quotation: <code>"\\$results\c$\direc\Desktop\Start Menu\Programs\Startup"</code></p>

<p>Double quotes: <code>""\\$results\c$\direc\Desktop\Start Menu\Programs\Startup""</code></p>

<p>Backtick in front of the space: <code>"\\$results\c$\direc\Desktop\Start` Menu\Programs\Startup"</code></p>

<p>8.3 name: <code>"\\$results\c$\direc\Deskto~1\StartM~1\Progra~1\Startu~1"</code></p>

<p>Here is my code:</p>

<pre><code>$inputFile = "C:\Users\$env:username\Desktop\workstations.csv"
$results = @()
Import-CSV -Path $inputFile -Header Workstations | % {
  Invoke-Item -Path "\\$results\c$\JHMCIS\Desktop\Start Menu\Programs\Startup"
}
</code></pre>

<p>Everything works perfect until it reads the file path. It then kicks back an error that says the path does not exist.  </p>