Chinaunix首页 | 论坛 | 博客
  • 博客访问: 186012
  • 博文数量: 33
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 182
  • 用 户 组: 普通用户
  • 注册时间: 2014-06-17 17:57
个人简介

IT运维工程师

文章分类

全部博文(33)

文章存档

2015年(20)

2014年(13)

我的朋友

分类: WINDOWS

2014-09-17 18:32:31

powershell默认禁止执行脚本:
问题:
PS C:\Users\Administrator> C:\11.ps1
File C:\11.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about
_signing" for more details.
At line:1 char:1
+ C:\11.ps1 <<<<
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException
解决:
查明了原因是由于操作系统默认禁止执行脚本,执行一次set-executionpolicy remotesigned后脚本顺利执行
PS C:\Users\Administrator> set-executionpolicy remotesigned
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution
policy?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):y


关于Set-ExecutionPolicy详细信息:
Set-ExecutionPolicy可更改Windows PowerShell执行策略的用户首选项。要在Windows Vista、Windows Server 2008 和 Windows
的更高版本上运行此命令,必须使用\"以管理员身份运行\"选项启动 Windows PowerShell,即使您是计算机上
Administrators 组的成员,执行策略是 Windows PowerShell 安全策略的一部分。它确定是否可以加载配置文件(包括 Windows PowerShell 
配置文件)和运行脚本,并且确定哪些脚本(如果有)在运行之前必须进行数字签名。

阅读(2492) | 评论(0) | 转发(0) |
0

上一篇:中间件ActiveMQ安装

下一篇:linux下安装pssh

给主人留下些什么吧!~~