windows powershell错误 because the execution of scripts is disabled on this system

来源:互联网 发布:r studio for mac 编辑:程序博客网 时间:2024/05/22 07:50

原因:需要修改策略为unrestricted


解决方法:

1. 以管理员身份运行PowerShell。

2. 检查当前状态:输入 Get-ExecutionPolicy ,回车。 显示: Restricted 。

3. 修改状态:输入 Set-ExecutionPolicy Unrestricted 

4. 再次输入 Get-ExecutionPolicy 检查状态应该显示 Unrestricted

===========================================================================

windows powershell 打开方法:

1、进入cmd命令行,输入start powershell,进入powershell

2、将文件后缀改为ps1,右击编辑或者以powershell运行


0 0
原创粉丝点击