Roslyn安装程序-Powershell脚本
我一直在尝试安装Rosyln源代码,并遵循 第一条指令是运行Restore.cmd,它会生成以下错误消息:Roslyn安装程序-Powershell脚本,powershell,roslyn,executionpolicy,Powershell,Roslyn,Executionpolicy,我一直在尝试安装Rosyln源代码,并遵循 第一条指令是运行Restore.cmd,它会生成以下错误消息: File C:\Code\roslyn-master\build\scripts\build.ps1 cannot be loaded. The file C:\Code\roslyn-master\build\scripts\build.ps1 is not digitally signed. You cannot run this script on the current sys
File C:\Code\roslyn-master\build\scripts\build.ps1 cannot be loaded.
The file C:\Code\roslyn-master\build\scripts\build.ps1 is not digitally signed.
You cannot run this script on the current system. For more information about
running scripts and setting execution policy, see about_Execution_Policies
at
http://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) [],
ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
我已使用Set ExecutionPolicy禁用检查:
PS C:\Code\roslyn master>获取执行策略-列表
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine Undefined
然而,我仍然收到相同的错误。我正在Windows 10 Pro计算机上运行Visual Studio 2017社区
提前谢谢
Jim该文件包含以下命令:
powershell-noprofile-executionPolicy RemoteSigned-文件“%~dp0\build\scripts\build.ps1”-还原%*
我将Powershell策略设置为什么并不重要-文件将覆盖它。当我删除execution policy子句时,文件运行正常。从管理员powershell运行
设置ExecutionPolicy Unrestricted
,然后重试?您好-是的,我最初尝试过-无论是对于Unrestricted还是Undefined(使用管理员命令提示符运行powershell)。同样的结果。就在那时,我修改了所有的作用域-我尝试了无限制和未定义。你尝试过吗?:Set ExecutionPolicy RemoteSigned process不幸的是,同样的错误。你知道为什么会发生这种情况吗?一个月前,我下载并让Roslyn启动并运行,但没有体验到这一点。然后今天我再次下载了它,这次是作为.zip下载,而不是作为GitHub存储库,我遇到了这个问题。如果“RemoteSigned”看到脚本来自存储库,而不适用于“未连接”下载,那么它是否可以工作?@RenniePet在我的例子中是cmd文件。我最初认为问题在于powershell环境的设置。然而,在cmd文件中,就像上面的restore一样,它们在命令中设置策略。当我删除执行策略参数时,它们运行良好。我从来没有发现他们为什么会这样设置-我想ps1文件应该已经签名,但没有。