找不到 Get-AzureSqlServerUpgrade commandlet

Can not find Get-AzureSqlServerUpgrade commandlet

找不到

Stop-AzureSqlServerUpgrade
Start-AzureSqlServerUpgrade
Get-AzureSqlServerUpgrade

安排升级到 SQL 数据库 V12 所需的命令。如何安装这些命令。

疑难解答详细信息

PS C:\Windows\system32> Get-Module Azure

ModuleType Version    Name                                ExportedCommands                        
---------- -------    ----                                ----------------                        
Manifest   0.9.7      Azure                               {Add-AzureAccount, Add-AzureApplicati...



PS C:\Windows\system32> $Host.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1    

Get-AzureSqlDatabase 命令工作正常。

简答

您需要切换到新的 AzureResourceManager 模式。

Switch-AzureMode AzureResourceManager
Get-Command Stop-AzureSqlServerUpgrade

更多信息

Azure PowerShell 现在有两种模式:AzureServiceManagementAzureResourceManager。我们使用 Switch-AzureMode.

在这些之间切换

一些命令行开关仅在一种模式下可用。 Stop-AzureSqlServerUpgrade commandlet 及其兄弟仅在 AzureResourceManager 模式下可用。

如果要判断当前模式,可以运行Get-Module *azure*。输出将如下所示,包括您当前模式的 Name

ModuleType   Version   Name                   ExportedCommands
----------   -------   ----                   ----------------
Manifest     0.9.7     AzureResourceManager   {Add-AlertRule ...}

如果 Name 只是 Azure,那么您处于服务管理器模式。