我正在尝试从 AzureRM 升级到用于 powershell 的新 Az 模块。我们仍然有多种“遗留”服务管理 API 资源的使用,例如经典的 Azure 云服务,而这些(据我所知)仍然需要使用旧的 Azure powershell 模块。
我已卸载所有 AzureRM 模块,然后安装了新的 Az 模块。但这样做似乎破坏了旧的 Azure 模块。Azure 模块和 AzureRM 之间似乎存在依赖关系。运行任何服务管理命令,例如“Get-AzureService”,结果如下:
PS C:\WINDOWS\system32> Get-AzureService
Get-AzureService : Exception has been thrown by the target of an invocation.
At line:1 char:1
+ Get-AzureService
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureService], TargetInvocationException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureServiceCommand
我尝试更新到最新的 Azure powershell 模块(Update-Module Azure)。这似乎也安装了 AzureRM.profile。
由于该模块不能与 Az 模块同时安装/使用,我不知道如何继续。
如果您还想使用新的 Az 模块,是否无法通过 powershell 使用旧的服务管理 API?


