HaPpY hApPy

내가 만든 파워셀이 내 컴퓨터에서 작동안될때. Set-ExecutionPolicy RemoteSigned 본문

PowerShell

내가 만든 파워셀이 내 컴퓨터에서 작동안될때. Set-ExecutionPolicy RemoteSigned

juniguya 2013. 2. 13. 12:37
File C:\Users\Desktop\Startup.ps1 cannot be loaded because the execution
of scripts is disabled on this system. Please see "get-help about_signing" for more detai
ls.
At line:0 char:0

위와 같은 오류가 나오면 파워셀에서 아래 명령어 수행해주면됨.
Set-ExecutionPolicy RemoteSigned

만약 위에 명령어를 치고 아래와 같은 에러를 보게되면

Set-ExecutionPolicy : Access to the registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell’ is denied.
At line:1 char:20

+ Set-ExecutionPolicy <<<< RemoteSigned

아래의 순서대로 실행하면 됨
  • Open registry by opening the start menu and typing regedit into the search box
  • Browse to key HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
  • If “ExecutionPolicy” does not exist, create it as REG_SZ with value “RemoteSigned”
  • Open PowerShell and use the command “Get-ExecutionPolicy” to verify it is set correctly


    혹은 그냥 HKLM\SOFTWARE\Microsoft\PowerShell\1 우측 클릭하고 permission 클릭 그다음 계정추가(현재 로그인 계정) 그리고 full control 옵션과 read 옵션 체크해주면 됨 ;)