⚠️Error
[VSCode] Firebase login PSSecurityException 오류 / firebase : 이 시스템에서 스크립트를 실행할 수 없으므로 firebase.ps1 파일을 로드할 수 없습니다.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0fca5775-60dc-4b0b-860b-5442efd47466%2FUntitled.png?table=block&id=c01d243e-a969-47c2-9452-3ecc32e6f17f&cache=v2)
- firebase 공부 중
firebase login
시 위 처럼 에러가 났다.
- firebase.ps1 스크립트 파일 실행 권한이 없어서 나타난 에러이다.
에러 해결 방법
1. Windows PowerShell을 관리자 권한으로 실행한다.
2. get-ExecutionPolicy
입력
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fefaea162-d01c-4fbe-af0e-46404ef39767%2FUntitled.png?table=block&id=ccc93c30-6113-4f20-8336-2df8d037ad44&cache=v2)
- Restricted : 구성파일을 로드하지 않고 스크립트를 실행하지 않는다. 윈도우 클라이언트 컴퓨터 기본정책
3. Set-ExecutionPolicy RemoteSigned
입력
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6089acbe-e7dd-45bd-b808-a77457785e3b%2FUntitled.png?table=block&id=a9a5ce69-b94b-4cb9-895f-3d72b3d587a6&cache=v2)
- y도 입력
get-ExecutionPolicy
다시 입력 해보면 변경이 되었다!
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa6236b38-94f6-4867-a936-e195bcbe1dfe%2FUntitled.png?table=block&id=ddb4f111-6c60-49f3-86c8-f6c172b3b568&cache=v2)
VSCode로 돌아가 다시 firebase login
을 하면 잘 작동한다.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6f6744d4-7a3d-4493-a7be-8becd8806577%2FUntitled.png?table=block&id=e325387a-1087-4599-8b12-29adef338702&cache=v2)
Windows PowerShell 스크립트 정책
- AllSigned
- 스크립트가 디지털 서명되어야만 실행될 수 있는 실행 정책
- 로컬 컴퓨터에서 작성한 스크립트도 서명되어야 하며, 인터넷에서 다운로드한 스크립트도 서명되어야 한다.
- Bypass
- 행 정책을 적용하지 않으며, 모든 스크립트를 실행할 수 있다.
- 이 설정은 보안을 우회하므로 권장되지 않는다.
- RemoteSigned
- 로컬 컴퓨터에서 작성한 스크립트는 디지털 서명이 필요하지 않지만, 인터넷에서 다운로드한 스크립트는 서명되어야 한다.
- Restricted
- 구성파일을 로드하지 않고 스크립트를 실행하지 않는다. 윈도우 클라이언트 컴퓨터 기본정책
- Undefined
- 실행 정책이 지정되지 않았으며, PowerShell은 스크립트를 실행할 때 정책을 적용하지 않는다.
- Unrestricted
- 가장 관대한 실행 정책, 모든 스크립트를 실행할 수 있도록 허용
- 이 설정은 보안에 취약하므로 신중하게 사용해야 한다.
About Execution Policies