title: Why does ExecutionPolicy behavior vary across projects in Visual Studio?
body: <p>I have been using NuGet for quite some time on a particular PC.  Now, I created a new project in VS2010 (it's an MVC 4 Beta project using the Single Page App template if that matters).  When I select</p>
  
  <p>Tools / Library Package Manager / Package Manager Console</p>
  
  <p>The console window opens but displays the error:</p>
  
  <blockquote>
    <p>File C:\Program Files (x86)\Microsoft Visual Studio
    10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\1.7.30402.9028\Modules\NuGet\profile.ps1 cannot be loaded
    because the execution of scripts is disabled on this system. Please
    see "get-help about_signing" for more details.</p>
  </blockquote>
  
  <p>However, other projects can still open and use Package Manager Console.</p>
  
  <p>In each case, VS2010 is running as the same user.</p>
  
  <p>If I open a command prompt (using the same account under which VS2010 is running), start PowerShell, and enter the command</p>
  
  <blockquote>
    <p>Get-ExecutionPolicy</p>
  </blockquote>
  
  <p>PowerShell returns</p>
  
  <blockquote>
    <p>Restricted</p>
  </blockquote>
  
  <p>My understanding based on a <a href="http://www.hanselman.com/blog/SigningPowerShellScripts.aspx" rel="noreferrer">Scott Hanselman blog</a> is that scripts should not run at all if the ExecutionPolicy is restricted.</p>
  
  <p><strong>Why are existing projects able to use the Package Manager Console while a new one is not?</strong></p>
  
  <p>Update: Changing the ExecutionPolicy to AllSigned <em>and</em> restarting VS2010 solves the immediate problem, but my main question is why the other projects were able to bypass the established ExecutionPolicy.  VS2010 is <em>not</em> running as an administrator.</p>