VSCODE 터미널에서 http-server 를 실행시킬 일이 있었는데 이런 오류가 떴다.
http-server : 이 시스템에서 스크립트를 실행할 수 없으므로 파일을 로드할 수 없습니다. 자세한 내용은 about_Execution_Policies(https://go.microsoft.com/fwliLinkID=135170)를 참조하십시오.
+ http-server -v
+ ~~~~~~~~~~~
+ CategoryInfo : 보안 오류: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
오류의 원인은 현재 powershell의 권한 때문이었다.
해결법은 간단하다. powershell 을 관리자권한으로 실행시킨 후 아래 명령을 입력한다.
Set-ExecutionPolicy RemoteSigned
참고로 현재 powershell 의 권한을 알아보고 싶다면 아래 명령을 입력하면 된다.
Get-ExecutionPolicy