macos - 无法从 Mac 连接到 Azure
问题描述
我在 AzureRM.Profile 下看到 Connect-AzureRmAccount 命令:
Get-Command -Module AzureRM.Profile*
CommandType Name Version
Cmdlet Connect-AzureRmAccount 0.13.1
但是当我运行它时,会出现以下错误:
Connect-AzureRmAccount : The term 'Connect-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Connect-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-AzureRmAccount:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我搜索了 stackoverflow,检查了我有最新的 Powershell 版本,安装了 NetCore.Preview。我无法弄清楚出了什么问题,有人可以指导吗?
解决方案
在 MS PowerShell GitHub 上查看这两个未解决的问题
Mac OSX 的 Powershell Core 安装
https://github.com/PowerShell/PowerShell/issues/7178
文档:Connect-AzureRmAccount 错误?
这意味着……</p>
术语“Connect-AzureRmAccount”未被识别为名称
…它找不到,所以表现得好像它不是自动加载。
因此,对模块进行显式导入。
Get-Module -ListAvailable
Import-Module -Name AzureRM -DisableNameChecking -Force
推荐阅读
- angular - 当页面加载Angular 8时设置默认选项卡处于活动状态
- docker - 什么是面向容器的集群和节点?
- php - 使用 spatie/media-library,如何重命名上传文件的集合?
- java - PDFBox 返回丢失的后代字体字典
- python - 如何使用 statsmodels GLM fit_constrained 将输出约束为正
- javascript - 对话流如何从谷歌日历播放下一次可用的时间
- scala - java中Set的scala等价物是什么?
- c# - 使用模板动态生成代码
- sql-server - SQL DELETE 两次或 DELETE 与 OR 哪个性能更高?
- r - 带有列组的 pivot_longer