如果将电源外壳执行策略设置设置为allsigned,则无法初始化电源外壳主机打开包管理器控制台以首先初始化外壳 [英] failed to initialize the power shell host if your power shell execution policy settings is set to allsigned open the package manager console to initialize the house first

查看:71
本文介绍了如果将电源外壳执行策略设置设置为allsigned,则无法初始化电源外壳主机打开包管理器控制台以首先初始化外壳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"如果设置了powershell执行策略设置,则无法初始化powershell主机allsigned打开包管理器控制台以首先初始化主机"

解决方案

< blockquote>

您好sergio36791,


感谢您在MSDN论坛上发帖。


根据错误信息,请查看:


http ://stackoverflow.com/questions/10457039/why-does-executionpolicy-behavior-vary-across-projects-in-visual-studio


请试试  ; Murries的解决方案:


1。以管理员身份打开Powershell


2。输入以下命令"Set-ExecutionPolicy RemoteSigned"


3。重启Visual Studio并且程序包管理器控制台按预期工作


重要的是要注意,Powershell会给你一个警告


"执行策略有助于保护您免受不信任的脚本的侵害。更改执行策略可能会使您面临about_Execution_Policies帮助主题中描述的安全风险。是否要更改执行政策?"


并且应该小心启用此功能,并应阅读有关安全性的帮助主题中的更多信息风险。


此外,您可能必须更改不同版本PowerShell的权限(32位和64位版本需要单独的权限)。


来自
如何判断PowerShell是32位还是64位



  • 64位PowerShell路径:  C:\ Windows \ System32 \ WindowsPowerShell \v1.0 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ thepowershell.exe

如果错误仍然存​​在,请随时告诉我,我会帮助您进一步排查故障。


最好的问候,







"Failed to initialize the powershell host if your powershell execution policy setting is set too allsigned open the package manager console to initialize the host first"

解决方案

Hi sergio36791,

Thank you for posting in MSDN forum.

According to the error information, please take a look at :

http://stackoverflow.com/questions/10457039/why-does-executionpolicy-behavior-vary-across-projects-in-visual-studio

Please have a try with Murries's solution:

1. Open Powershell as an Administrator

2. Enter the following command "Set-ExecutionPolicy RemoteSigned"

3. Restart Visual Studio and the Package Manager Console worked as expected

It is important to note however that Powershell will give you a warning

"The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy?"

And should be careful of enabling this feature and should read more information in the help topics about the security risks.

In addition, you might have to change the permissions on a different version of PowerShell (32-bit and 64-bit versions require separate permissions).

From How to Tell if PowerShell is 32-bit or 64-bit:

  • 64-bit PowerShell Path:  C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  • 32-bit PowerShell Path:  C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

If the error persists, please feel free to tell me, I will help you got further troubleshooting.

Best Regards,


这篇关于如果将电源外壳执行策略设置设置为allsigned,则无法初始化电源外壳主机打开包管理器控制台以首先初始化外壳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆