如果将电源外壳执行策略设置设置为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
问题描述
< blockquote>
您好sergio36791,
感谢您在MSDN论坛上发帖。
根据错误信息,请查看:
请试试  ; Murries的解决方案:
1。以管理员身份打开Powershell
2。输入以下命令"Set-ExecutionPolicy RemoteSigned"
3。重启Visual Studio并且程序包管理器控制台按预期工作
重要的是要注意,Powershell会给你一个警告
"执行策略有助于保护您免受不信任的脚本的侵害。更改执行策略可能会使您面临about_Execution_Policies帮助主题中描述的安全风险。是否要更改执行政策?"
并且应该小心启用此功能,并应阅读有关安全性的帮助主题中的更多信息风险。
此外,您可能必须更改不同版本PowerShell的权限(32位和64位版本需要单独的权限)。
- 64位PowerShell路径: C:\ Windows \ System32 \ WindowsPowerShell \v1.0 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ thepowershell.exe
如果错误仍然存在,请随时告诉我,我会帮助您进一步排查故障。
最好的问候,
Hi sergio36791,
Thank you for posting in MSDN forum.
According to the error information, please take a look at :
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屋!