2
Vote

powershell policy in a new Win81+VS2013 box

description

I just installed a brand new box with:
  • win81 pro
  • VS2012
  • VS2013
I then created a new asp.net / mvc project and the wizard failed with the error:
"failed to initialize powershell host Visual Studio2013"

I opened powershell and the Get-ExecutionPolicy was set to "Restricted"
This is quite weird on a dev box, no?

Anyway I solved the problem by changing it with Set-ExecutionPolicy to "RemoteSigned"

I expect:
  • any wizard should work without any "hack"
  • VS2013 should always work in disconnected world because more than half of the so called civilized part of the planet works disconnected
Cheers

file attachments

comments

JeffHandley wrote Sep 13, 2013 at 5:02 PM

Thanks for filing this. Downloading should be out of the picture. Nothing gets downloaded during new project creation, or any other time unless you go install a new package/version or utilize package restore.

I believe this error is happening before any scripts are even attempted to be executed too, so the execution policy workaround might be misleadingly pointing the finger at scripts failing to execute. When you were setting the execution policy (or getting it), was that from a PowerShell command window in Windows, or the Package Manager Console in VS?

Without setting that, does the Package Manager Console in VS function at all?

raffaeler wrote Sep 13, 2013 at 5:38 PM

You're welcome.
I changed the policy via windows cmd and than restarted vs2013.

I did not try the PMC from VS

raffaeler wrote Sep 13, 2013 at 5:59 PM

This is the screenshot of the repro

raffaeler wrote Sep 13, 2013 at 6:02 PM

Re-sending the attachment

raffaeler wrote Sep 13, 2013 at 6:05 PM

I posted the image here: http://sdrv.ms/1dbbl5Q

raffaeler wrote Sep 13, 2013 at 6:06 PM

Final message from the wizard:

File C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\EW4SDVF0.I2C\Modules\NuGet\nuget.psm1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.

raffaeler wrote Sep 13, 2013 at 6:09 PM

The package manager console opens correctly (with the restricted policy set).
I tried before creating a projects (with no project loaded) and after the wizard gave me the errors

ericardezp wrote Mar 26 at 6:53 PM

I have the same error. Any solutions?

ericardezp wrote Mar 26 at 6:57 PM

Hi i found this TEXT

It works well and fixed error

ericardezp wrote Mar 26 at 7:00 PM

jajajajaja

works well only the first time

Sorry