programing

"실행 중인 스크립트가 이 시스템에서 비활성화됨"을 수정하는 방법은 무엇입니까?

subpage 2023. 9. 1. 21:00
반응형

"실행 중인 스크립트가 이 시스템에서 비활성화됨"을 수정하는 방법은 무엇입니까?

다음과 같은 이온 명령을 실행하려고 할 때ionic serveVS Code 터미널에서 다음과 같은 오류가 발생합니다.

이걸 어떻게 고칠 수 있을까요?

ionic : File C:\Users\Lakshan\AppData\Roaming\npm\ionic.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see 
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

저는 이 오류를 해결할 방법을 찾았습니다.

다음과 같습니다.

  1. 먼저 관리자 권한으로 실행하여 PowerShell을 엽니다.
  2. 그런 다음 PowerShell에서 이 명령을 실행합니다.
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
    
  3. 그 유형 이후YEnter 키를 누릅니다.

이는 실행 정책 때문입니다.파워셸 스크립트가 실행되는 방법을 정의합니다.

기본 윈도우즈 데스크톱에서는 스크립트(서명 또는 서명되지 않은) 대화형 세션만 허용하지 않으므로 제한됩니다.

따라서 설정하는 것이 가장 좋습니다.RemoteSigned(Windows Server의 기본값) 원격에서 서명된 스크립트와 로컬에서 서명되지 않은 스크립트만 실행하도록 허용하지만Unrestriced모든 스크립트를 실행하도록 허용하는 것은 안전하지 않습니다.

실행 설정하기Set-ExecutionPolicy -ExecutionPolicy RemoteSigned관리자로서

이 코드로 해결할 수 있습니다.

Set-ExecutionPolicy RemoteSigned –Scope Process

이를 무시하려면 실행 정책을 변경해야 합니다.단말기에 입력합니다.

Set-ExecutionPolicy -Scope CurrentUser

그런 다음 Bypass / Remote Signed 또는 Restricted를 설정할 수 있는 값을 입력하라는 메시지가 표시됩니다.

cmdlet Set-ExecutionPolicy at command pipeline position 1
Supply values for the following parameters:
ExecutionPolicy: "RemoteSigned" or "Bypass" or "Restricted".

언급URL : https://stackoverflow.com/questions/64633727/how-to-fix-running-scripts-is-disabled-on-this-system

반응형