【问题标题】:Missing Azure cmdlets from PowerShell v5PowerShell v5 中缺少 Azure cmdlet
【发布时间】:2017-06-18 09:12:31
【问题描述】:

好的,所以我正在尝试使用 Powershell 控制我的第一个 Azure 实例。 我在 Windows 10 上,我运行 $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

我正在尝试遵循本指南:https://msdn.microsoft.com/en-us/library/mt125356.aspx

所以我输入“Install-Module AzureRM”就可以了

然后我输入“Install-AzureRM”

我明白了:

Install-AzureRM : The term 'Install-AzureRM' 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
+ Install-AzureRM
+ ~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Install-AzureRM:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

我可以使用“Login-AzureRmAccount”查看我的订阅信息。但是如果我尝试使用

PS C:\WINDOWS\system32> Remove-AzureADGroup
Remove-AzureADGroup : The term 'Remove-AzureADGroup' 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
+ Remove-AzureADGroup
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Remove-AzureADGroup:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS C:\WINDOWS\system32> Get-MsolGroup
Get-MsolGroup : The term 'Get-MsolGroup' 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
+ Get-MsolGroup
+ ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-MsolGroup:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

没有任何效果,我遇到的每一个指南似乎都已经过时了两年,并且针对 Azure PS 连接指的是 V2 或更低版本。

我的最终目标是通过 cmdlet 从 AD 中删除一个组,但我似乎无法让这一切正常工作。

【问题讨论】:

  • 可能值得在导入模块后运行get-command -Module AzureRM 以获取可用命令列表。
  • 我不相信 Install-Module AzureRM 的工作效果和您想象的一样好,可能值得运行 Install-Module AzureRM -Verbose 并分享输出。

标签: powershell azure


【解决方案1】:

我……感觉……真的很傻。 因此,在我发布此内容后,我发现另一个技术网链接隐藏在另一个技术网博客中。

事实证明我不需要上述任何一项(对于我想要完成的事情) 简单地遵循这个: https://docs.microsoft.com/en-us/azure/xplat-cli-install#option-2-use-an-installer

然后使用这些: https://docs.microsoft.com/en-us/azure/virtual-machines/azure-cli-arm-commands#azure-account-manage-your-account-information

【讨论】:

  • 很好,你解决了它,但是......这不属于你的问题(或标题)。我回滚了你的编辑。
【解决方案2】:

引用的文章真的非常非常老了,如果你尝试去那里,你现在会被重定向到新页面:https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-4.1.0。你应该只需要运行 安装模块 AzureRM

此外,AzureAD 模块不是 AzureRM 的一部分。 AzureRM 中包含一小组 AD cmdlet,允许您操作 AAD 用户、组和应用程序,但它没有 AzureAD mdoule 的完整 AD 和 MS Graph 支持

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多