2013-05-01 3 views
0

PowerShell 스크립트를 실행하려면 어떻게해야합니까?
File cannot be loaded because the execution of scripts is disabled on this systemPowerShell 스크립트를 실행할 수 없습니다.

당신이 내 스크립트를 실행하는 데 도움 수 :

내 스크립트를 실행 나는 오류가?

set-executionpolicy unrestricted 
#Set-ExecutionPolicy RemoteSigned 

$target=[IO.File]::ReadAllText(".\usermenuTest1.4d") 
$output=[IO.File]::ReadAllText(".\usermenuTest2.4d") 

($output -replace $target) | Set-Content "usermenuTest2.4d.new" 

Start-Sleep -s 10 

답변

3

This Technet article는 스크립트 실행 정책을 확인 Get-ExecutionPolicy을 시도하고 AllSigned 또는 Unrestricted로 설정 제안한다. 또한 스크립트를 다음과 같이 실행하십시오. ".\scriptname.ps1"

+0

RemoteSigned는 ExecutionPolicy에 널리 사용되는 또 다른 값입니다. –

+5

'& powershell.exe -executionpolicy bypass -file C : \ script.ps1' 실행 정책을 완전히 무시하십시오. –

+0

'Set-ExecutionPolicy Unrestricted -Scope Process -Force'를 사용하여 시스템 기본값을 변경하지 않고 임시로 주위를 둘러 볼 수도 있습니다 –

관련 문제