安装后缺少Azure PowerShell cmdlet

时间:2017-05-09 02:34:40

标签: powershell azure module cmdlets

想问一下是否有人遇到过这类问题?虽然我已经安装了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...

1 个答案:

答案 0 :(得分:0)

我的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:

请尝试重新安装