[英]Importing Azure Rm gives me an error
I have a windows 7 Professional SP1 machine and have installed the windows azure poweshell version 3.7.0 and also have installed the azure rm successfully.我有一台 windows 7 Professional SP1 机器,已经安装了 windows azure poweshell 版本 3.7.0,还成功安装了 azure rm。 But whenever i am trying to import the Azure Rm via the admin login i get the following error
但是每当我尝试通过管理员登录导入 Azure Rm 时,我都会收到以下错误
PS C:\Users\swagh> Import-Module AzureRM
Import-Module : File C:\Program Files\WindowsPowerShell\Modules\AzureRM\4.2.1\AzureRM.psm1 cannot b
its operation is blocked by software restriction policies, such as those created by using Group Pol
At line:1 char:1
+ Import-Module AzureRM
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
I have tried several ways, uninstalling and reinstalling etc...but failed.我尝试了几种方法,卸载和重新安装等...但都失败了。 Can anyone please help me?
谁能帮帮我吗?
The answer is right there in the error message, though it's not copied completely from the Powershell console: 答案就在错误消息中,尽管它没有从Powershell控制台中完全复制出来:
Import-Module : ... its operation is blocked by software restriction policies , such as those created by using Group Pol
Import-Module:... 其操作被软件限制策略阻止 ,例如使用Group Pol创建的策略
This means that a domain SRP prevents you loading the module. 这意味着域SRP阻止您加载模块。 Contact your domain administrator to discuss SRP settings .
请与您的域管理员联系以讨论SRP设置 。
To fix this you need to change the execution policy by this simple command:要解决此问题,您需要通过以下简单命令更改执行策略:
PS c:> Set-ExecutionPolicy RemoteSigned PS c:> Set-ExecutionPolicy RemoteSigned
then reply Y(yes) to the popup to change setting.然后在弹出窗口中回复 Y(是)以更改设置。 Now try running again the import command, it will run:
现在尝试再次运行 import 命令,它将运行:
PS c:> Import-Module AzureRM PS c:> 导入模块 AzureRM
this worked for me, i hope it helps you too这对我有用,我希望它也能帮助你
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.