【发布时间】: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