简体   繁体   English

导入 Azure rm 给我一个错误

[英]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.

相关问题 在在线端点中导入 MLClient 会出现错误“无法从 azure.core.credentials 导入名称 TokenCredential” - Importing MLClient in online endpoint gives error "cannot import name TokenCredential from azure.core.credentials" 从Azure数据工厂调用Azure Function报404错误 - Calling Azure Function from Azure Data Factory Gives 404 Error Python 在 Mac Monterey 上导入 azure-eventhub 时出错 - Python Error when importing azure-eventhub on Mac Monterey 谷歌云 SDK:gcloud auth login 给我一个错误 - Google Cloud SDK: gcloud auth login gives me an error 'firebase init' 给了我一个离子项目的一般错误 - 'firebase init' gives me a generic error on a ionic project Django + Azure 中的 React App 给出服务器错误 - 每次 500 - Django + React App in Azure gives a server error - 500 everytime azure_rm Ansible 插件解析动态库存失败 - azure_rm Ansible plugin fails to parse dynamic inventory 即使我没有更改示例项目中的任何内容,使用 Google Actions 控制台也会出现错误 - Using the Google Actions console gives me an error, even if I didn't change anything in the sample project .NET7 升级后,在本地运行 Azure 函数会出现“无运行时”错误 - Running Azure functions locally gives "No runtime" error after .NET7 upgrade Azure 面部识别给出“仅 recognition_03 和 recognition_04 支持属性‘qualityForRecognition’。” 错误 - Azure Face Recognition gives "Attribute 'qualityForRecognition' is only supported for recognition_03 and recognition_04." error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM