【问题标题】:After updating Azure Powershell module cannot import my module anymore and getting strange error更新 Azure Powershell 模块后无法再导入我的模块并出现奇怪的错误
【发布时间】:2017-11-15 01:45:06
【问题描述】:

我刚刚更新到最新的 Azure powershell,但之后我无法再导入我的模块(很长一段时间都可以正常工作)。这是我得到的错误:

导入模块:来自程序集的“Microsoft.Azure.Commands.Automation.Cmdlet.GetAzureAutomationCertificate”类型中的方法“get_DataCollectionWarning” 'Microsoft.Azure.Commands.Automation, Version=4.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 没有实现。 在行:1 字符:1 + 我 .\MyResources.psd1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadException + FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand

有人可以建议这里可能出了什么问题。请注意,没有实现的方法似乎来自 Azure PS 包。

【问题讨论】:

  • 您要导入的模块是什么?它是标准 Azure PowerShell 模块还是您自己的 PowerShell 模块?

标签: powershell azure azure-powershell


【解决方案1】:

如果您已将 Azure PowerShell 升级到版本 5.0.0,则它是基于其release notes重大变更发布

您应该参阅migration guide 了解引入的重大更改的完整列表。

此外,Azure PowerShell 团队还发布了更新的版本 5.0.1,修复了可能也与您的问题有关的问题。

修复了导致某些 cmdlet 失败的程序集加载问题 在以下模块中执行:

  • AzureRM.ApiManagement
  • AzureRM.Backup
  • AzureRM.Batch
  • AzureRM.Compute
  • AzureRM.DataFactories
  • AzureRM.HDInsight
  • AzureRM.KeyVault
  • AzureRM.RecoveryServices
  • AzureRM.RecoveryServices.Backup
  • AzureRM.RecoveryServices.SiteRecovery
  • AzureRM.RedisCache
  • AzureRM.SiteRecovery
  • AzureRM.Sql
  • AzureRM.Storage
  • AzureRM.StreamAnalytics

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-04
    • 1970-01-01
    • 1970-01-01
    • 2021-12-10
    • 2021-10-24
    • 1970-01-01
    相关资源
    最近更新 更多