POWERSHELL脚本执行权限

1.PowerShell脚本四种执行权限html

Restricted——默认的设置, 不容许任何script运行windows

AllSigned——只能运行通过数字证书签名的script网络

RemoteSigned——运行本地的script不须要数字签名,可是运行从网络上下载的script就必需要有数字签名工具

Unrestricted——容许全部的script运行开发工具

2.查看当前的权限spa

Get-ExecutionPolicy
命令行

3.设置执行权限rest

windows默认不容许任何脚本运行,你能够使用"Set-ExecutionPolicy"cmdlet来改变的你PowerShell环境。例如,你能够使用以下命令让PowerShell运行在无限制的环境之下:htm

Set-ExecutionPolicy Unrestrictedblog

但在win7/win8/win10下,必须使用管理员的权限启动命令命令行,不然会报“Set-ExecutionPolicy : 对注册表项“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell”的访问被拒绝。”错误。



使用系统管理员身份启动PowerShell


4.开发工具

PowerGUI 很是好的一款开发工具,下载地址:http://www.xdowns.com/soft/6/56/2013/Soft_105129.html

VS也能够开发PowerShell,下载地址本身百度,不少地方都有下载!