PowerShell 이 시스템 에서 스 크 립 트 실행 을 금지 하 는 해결 방법

Powershell 직접 스 크 립 트 에 나타 날 때:
파일*****.ps1 을 불 러 올 수 없습니다.이 시스템 에서 스 크 립 트 를 실행 할 수 없습니다.자세 한 정 보 는"get-help about"를 참조 하 시기 바 랍 니 다.signing"。
위치 줄:1 글자:17
+ E:\Test\test.ps1 <<<<
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
ps1 의 내용:

powershell 에서 set-Execution Policy RemoteSigned 실행

아래 그림 은 원래 실행 할 수 없 었 던 것 을 볼 수 있 습 니 다.위의 명령 을 실행 하면 됩 니 다.다음 그림 과 같 습 니 다.

보기"get-help aboutsigning”:
메시지
about_signing
간단 한 설명
Windows PowerShell 실행 정책 에 맞 게 스 크 립 트 에 서명 하 는 방법 을 설명 합 니 다.
자세하게 설명 하 다
Restricted 실행 정책 은 스 크 립 트 가 실 행 될 수 없습니다.
AllSigned 와 RemoteSigned 실행 정책 은 Windows PowerShell 로 디지털 서명 이 없 는 스 크 립 트 를 실행 하 는 것 을 방지 합 니 다.
이 테 마 는 선택 한 서명 되 지 않 은 스 크 립 트 를 어떻게 실행 하 는 지 설명 합 니 다.
스 크 립 트 를 직접 사용 할 수 있 도록 서명 합 니 다.
Windows PowerShell 실행 정책 에 대한 자세 한 정 보 는 about 를 참조 하 십시오.Execution_Policy。
서명 스 크 립 트 실행 허용
-------------------------------
Windows PowerShell 을 컴퓨터 에서 처음 시작 할 때 현재 실행 정책 을 사용 하면 Restricted(기본 설정)일 수 있 습 니 다.
Restricted 정책 은 스 크 립 트 가 실 행 될 수 없습니다.
컴퓨터 의 현재 실행 정책 을 알 고 싶다 면 입력 하 십시오:
get-executionpolicy
로 컬 컴퓨터 에서 작 성 된 서명 되 지 않 은 스 크 립 트 와 다른 사용자 의 서명 스 크 립 트 를 실행 하려 면 다음 명령 을 사용 하여 컴퓨터 에 있 는
실행 정책 을 RemoteSigned 로 변경:
set-executionpolicy remotesigned
자세 한 정 보 는 Set-ExecutionPolicy 를 참조 하 십시오.
"set-ExecutionPolicy RemoteSigned "실행:
정책 변경 실행
정책 을 실행 하면 신뢰 하지 않 는 스 크 립 트 를 실행 하 는 것 을 방지 할 수 있 습 니 다.실행 정책 을 변경 하면 aboutExecution_Policies
주제 에서 말 한 안전 위험 을 돕다.실행 정책 을 변경 하 시 겠 습 니까?
[Y]예(Y)[N]아니오(N)[S]걸 기(S)[?]도움말(기본 값"Y"):y
Run a CMD batch file
To run a batch script from the CMD shell, save the file as plain ASCII text with the file extension .CMD, then from the command line, enter the name of the script and press return.
C:\Batch> Demo.cmd
To run a batch file from within another batch file, use the CALL command, otherwise the first script will exit without performing any further commands.
It is also possible to run batch scripts with the old (Windows 95 style) .BAT extension, but be aware that these will set ERRORLEVEL differently.
Run a Powershell script
To run a PowerShell script from the CMD shell:

C:\> powershell -file "c:\batch\demo.ps1"
Run a VBScript file
To run a VBScript from the CMD shell:

C:\> cscript c:\batch\demo.vbs
“The method of the enterprising is to plan with audacity and execute with vigor” ~ John Christian Bovee

좋은 웹페이지 즐겨찾기