Alternatives to fix powershell error "execution of scripts is disabled on this system" -
i have power-shell
script written me. try run power-shell
script below;
ps c:\documents , settings\administrator>c:\test\test.ps1
so giving me error saying file c:\test\test.ps1 cannot loaded because execution of scripts disabled on system. please see "get-help about_signing" more details.
i found setting set-executionpolicy unrestricted
fix error.
but questions are;
- what signing about?
- can fix error without setting
set-executionpolicy unrestricted
? (doing signing kind of thing). if how that? - is there security issue arise if set
set-executionpolicy unrestricted
in web server?
set-executionpolicy
causes system wide change. scripts possible security vulnerabilities, why script execution disabled default. 1 possibility launch powershell process command line execution policy in effect specific session. command line like:
> powershell.exe -executionpolicy unrestricted -file "c:\test\test.ps1"
you combine signing leaving default policy restricted , launching powershell remotesigned or allsigned policy when needed. additional information on powershell.exe command line options here.
Comments
Post a Comment