如何在PowerShell中更改machinepolicy?目前其Allsigned

时间:2013-05-23 07:22:18

标签: windows powershell-v2.0

get-executionpolicy -list

MachinePolicy AllSigned                                                                                  UserPolicy未定义                                                                                     流程未定义                                                                                 CurrentUser未定义                                                                                LocalMachine Unrestricted

1 个答案:

答案 0 :(得分:-2)

如果要向所有用户(可能是企业TS环境)开放机器,除了“ALLSIGNED”之外我不会推荐任何东西,但是如果这只是你在本地个人机器上玩的话,你可以安全地设置它通过输入

来“不受限制”
 set-executionpolicy unrestricted

但是,如果这是一台不属于您的机器或由IT人员管理的机器,除非您打算恢复到“ALLSIGNED”或“Restricted”,否则请不要这样做。这可以通过在完成后输入以下命令来完成:

 set-execution policy restricted

set-executionpolicy ALLSIGNED