title: Powershell Executed from Path with Space Produces No Output
body: <p>From within Powershell and Powershell ISE, Powershell scripts that exist in locations with a space in the path do not execute, or at least their output is not shown in the command window.</p>
  
  <p>I have a Powershell script (<code>helloworld.ps1</code>) that contains only the following code:</p>
  
  <pre><code>Write-Host "Hello World"
  </code></pre>
  
  <p>If the script is executed from:</p>
  
  <pre><code>"C:\Temp\helloworld.ps1"
  </code></pre>
  
  <p>The output is: <code>Hello World</code></p>
  
  <p>If the script is executed from:</p>
  
  <pre><code>"C:\Program Files\Microsoft Office\helloworld.ps1"
  </code></pre>
  
  <p>The output is blank. <code></code></p>
  
  <p>Note that the path is surrounded with quotes when executed (otherwise, obviously, I would have errors). I've duplicated this same problem on multiple machines in multiple environments, so it doesn't seem to be a configuration issue. </p>
  
  <p><strong>For what reason is Powershell output hidden if the script itself is executed from a path that contains a space</strong>?</p>