Is setting ExecutionPolicy to Unrestricted for CurrentUser a security breach?

半腔热情 提交于 2020-06-11 07:52:26

问题


I have a couple of aliases I like to have in my PowerShell on my Windows 10.

I want them to persist between sessions, so I have put them in a profile.ps1 file under C:\Users{username}\Documents\WindowsPowerShell.

I am getting this annoying "cannot be loaded because running scripts is disabled on this system." error message, and have found this page on how to get rid of it: https://social.technet.microsoft.com/Forums/en-US/3e4a9006-d47d-4e19-96f4-10327ae0c5b1/not-able-to-run-script-in-windows-10?forum=winserverpowershell

In here someone says that this line will help:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force -Verbose

But is it hazardous to just set the execution policy to unrestricted for my user?


回答1:


ExecutionPolicy is not a security boundary. As someone opined elsewhere in a comment, it is a safety feature. Think seat belt not door lock. But seat belts mitigate risk so it's better to use them than not. ExecutionPolicy mitigates the risk of unintentionally running malicious code. The generally recommended minimum policy is RemoteSigned.



来源:https://stackoverflow.com/questions/49772982/is-setting-executionpolicy-to-unrestricted-for-currentuser-a-security-breach

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!