当前位置:网站首页>PowerShell 执行策略 about_Execution_Policies
PowerShell 执行策略 about_Execution_Policies
2022-04-21 06:26:00 【山水牧羊】
目录
一、介绍
PowerShell执行策略是一项安全功能,用来管理PowerShell加载配置文件和运行脚本的条件,宾冕恶意脚本的执行。
二、执行策略
- AllSigned
- Bypass
- Default
- RemoteSigned
- Restricted
- Undefined
- Unrestricted
三、执行策略范围
- MachinePolicy
- UserPolicy
- Process
- CurrentUser
- LocalMachine
四、管理执行策略
1.查看执行策略
Get-ExecutionPolicy 获取有效的执行策略
PS C:\Users\yeqiy> Get-ExecutionPolicy
RemoteSigned
Get-ExecutionPolicy -List 获取所有执行策略
按优先级排序
PS C:\Users\yeqiy> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
可以看到,针对LocalMachine 执行策略是RemoteSigned。
Get-ExecutionPolicy -Scope CurrentUser 查看指定范围的策略
PS C:\Users\yeqiy> Get-ExecutionPolicy -Scope CurrentUser
Undefined
2.更改执行策略
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
3.删除执行策略
删除执行策略是将策略设置为Undefined,过程与修改相同。
Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine
更详细内容可查看
版权声明
本文为[山水牧羊]所创,转载请带上原文链接,感谢
https://blog.csdn.net/yeqiyugood/article/details/118182355
边栏推荐
猜你喜欢

传染病模型进行仿真Matlab(仅做Matlab仿真学习与练习,非实际情况与应用)

记一次mySQL慢sql优化

用JS函数形式实现一个Array.prototype.forEach(),.map(),.filter()

将在CSDN中写好的文章导出为pdf格式

CF1427C The Hard Work of Paparazzi题解

Implémenter un tableau en tant que fonction JS. Prototype. Foreach (),. Map (),. Filtre ()

数据异构方案

C语言版:二叉树的遍历方式和逆序

This site cannot provide a secure connection. An unsupported protocol is used

Semantic feature extraction and simple word frequency display (wordcloud)
随机推荐
2022牛客寒假补题记录 2
异步RPC的三种方式:异步调用,异步监听,callback调用
【LeetCode 401】二进制手表
Build your own blog
Solve the problem that the replacement traverses the circular call, resulting in the subsequent replacement replacing the data of the previous replacement
ST表模板
Eal:Error reading from file descriptor 33: Input/output error
数据的增删查改
The jupyter notebook of win10 uses pyspark 2 3.2 error reporting problems solved
How to prevent SQL injection
P1018 乘积最大题解
用MATLAB写一个自动生成福利彩票双色球号码的程序
TensorFlow
微服务——服务拆分策略与原则
【LeetCode217】存在重复元素
MySQL workbench cannot use clear text authentication over non SSL connections problem solving
【保姆安装教程】Linux操作系统中源码下载MySQL5.7
【LeetCode 6】Z 字形变换
How to implement a thread pool isolation?
CF515B Drazil and His Happy Friends题解