Настройка Roslyn - Скрипты Powershell

Я пытался установить исходный код Rosyln с Github и следовал инструкциям по сборке.

Первая инструкция - запустить 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 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> Get-ExecutionPolicy -List

Scope           ExecutionPolicy
-----           ---------------
MachinePolicy   Undefined
UserPolicy      Undefined
Process         Undefined
CurrentUser     Undefined
LocalMachine    Undefined

Тем не менее, я все еще получаю ту же ошибку. Я использую Visual Studio 2017 Community на компьютере с Windows 10 Pro.

заранее спасибо

Джим

1 ответ

Файл Restore.Cmd содержал следующую команду:

powershell -noprofile -executionPolicy RemoteSigned -file "% ~ dp0 \ build \ scripts \ build.ps1" -restore% *

Неважно, какую я установил политику Powershell - файл собирался переопределить ее. Когда я удалил условие политики выполнения, файл работал нормально.

Другие вопросы по тегам