Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Security 在已部署的计算机中,建议使用哪种powershell执行策略?_Security_Powershell - Fatal编程技术网

Security 在已部署的计算机中,建议使用哪种powershell执行策略?

Security 在已部署的计算机中,建议使用哪种powershell执行策略?,security,powershell,Security,Powershell,我正在部署一些powershell脚本作为应用程序的一部分 当用户需要运行该脚本时,我只想临时更改set executionpolicy。所以我记录如下 用户应在执行脚本之前键入以下命令 设置ExecutionPolicy Allsigned-作用域进程 它将在会话中临时设置为 根据安全指南,这是推荐的方法吗 您可以使用Powershell.exe的参数-executionpolicy为单个脚本执行设置策略,如下所示: c:\>powershell -executionpolicy all

我正在部署一些powershell脚本作为应用程序的一部分

当用户需要运行该脚本时,我只想临时更改set executionpolicy。所以我记录如下

用户应在执行脚本之前键入以下命令

设置ExecutionPolicy Allsigned-作用域进程

它将在会话中临时设置为


根据安全指南,这是推荐的方法吗

您可以使用
Powershell.exe
的参数
-executionpolicy
为单个脚本执行设置策略,如下所示:

c:\>powershell -executionpolicy allsigned -file c:\myScript.ps1

您可以将该命令包装在.cmd脚本中,并指示用户运行批处理脚本。因此,您根本不需要担心执行策略。相反,通过设置当前进程的执行策略,您可能会更改用户的会话设置。

这正是我一直在寻找的。我不想永久性地更改客户端的权限,而获取现有权限是一件困难的事情。