title: Why is my powershell script unable to create a folder in C:\Program Files?
body: <p>I am trying to create a script which will create a directory in the C:\Program Files folder.</p>
  
  <p>I am able to run the line to create it fine when I run in via an elevated powershell prompt manually - however when I run it via a script (elevated still) <strong>it simply creates a "file" object with the name I want instead of a folder.</strong></p>
  
  <p>Here is the code I am using to write the folder:</p>
  
  <pre><code>New-Item -ItemType Directory -Force -Path "C:\Program Files\Info"
  </code></pre>
  
  <p>I have also tried simply copying a folder into the Program Files location, with the same results. </p>
  
  <p>Is there anyway I can script this so it will work?</p>
  
  <p>I have found an old vbscript which does work to create the folder, so there must be a way to accomplish this in Powershell!?</p>
  
  <p>Thanks for your time</p>