【问题标题】:Missing Azure powershell cmdlet after install安装后缺少 Azure powershell cmdlet
【发布时间】:2017-05-09 02:34:39
【问题描述】:

想问问有没有人遇到过这种问题?尽管我已经安装了 Azure powershell,但我仍然以某种方式收到有关 Get-​Azure​Rm​Sql​Server cmdlet 的错误。这让我很困惑,因为我能够运行其他 cmdlet,例如 Get-AzureRmSqlDatabase

Get-​Azure​Rm​Sql​Server : The term 'Get-​Azure​Rm​Sql​Server' 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.

尝试手动导入模块,但仍然没有让步。

Import-Module 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Sql\AzureRM.Sql.psd1'

编辑: 运行后Get-Module -ListAvailable -Name Azure -Refresh 结果:

 Directory: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement


ModuleType Version    Name                                ExportedCommands                                                                                                           
---------- -------    ----                                ----------------                                                                                                           
Manifest   3.7.0      Azure                               {Get-AzureAutomationCertificate, Get-AzureAutomationConnection, New-AzureAutomationConnection, Remove-AzureAutomationCon...

【问题讨论】:

  • 能否请您运行此命令来检查您的 azure powershell Get-Module -ListAvailable -Name Azure -Refresh, 的版本?
  • 这是结果。 Directory: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement
  • ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Manifest 3.7.0 Azure {Get-AzureAutomationCertificate, Get-AzureAutomationConnection, New-AzureAutomationConnection, Remove-AzureAutomationCon...
  • 作为一种解决方法,也许我们应该卸载它,然后手动重新安装它,请检查我的答案。

标签: powershell azure module powershell-cmdlet


【解决方案1】:

我的 Azure PowerShell 版本是 3.7.0。
我下载 Azure PowerShell 并手动安装它,它对我有用。
也许你应该先卸载这个 PowerShell,然后用下载文件重新安装它。

PS C:\Users> Get-Module -ListAvailable -Name Azure -Refresh


    Directory: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   3.7.0      Azure                               {Get-AzureAutomationCertificate, Get-AzureAutomationConnec...


PS C:\Users\v-jianye> get-azurermsqlserver

cmdlet Get-AzureRmSqlServer at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
ResourceGroupName:

请尝试重新安装它。

【讨论】:

  • 如果我有机会重新安装它,我会尽快回复您,因为它目前在我们的 prod envi 中:( 感谢您的帮助!
  • @CarlArdiente 现在可以了吗?如果您需要进一步的帮助,请告诉我。
  • @CarlArdiente 现在可以用吗,如果您需要进一步的帮助,请告诉我,顺便说一下,如果有帮助,请不要忘记标记是一个答案,以便其他社区成员会受益。
  • 嗨@Jason Ye - MSFT,我没有重新安装Azure cmdlet,但由于某种原因它自行修复了。也许是因为我在另一个新的(管理员)PowerShell ISE 中打开了它。抱歉耽搁了
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-15
  • 2011-06-22
  • 1970-01-01
  • 2018-11-22
相关资源
最近更新 更多