【问题标题】:Powershell error Remove-AzureStorageBlob Method not found: 'VoidPowershell 错误 Remove-AzureStorageBlob Method not found: 'Void
【发布时间】:2021-09-08 14:04:14
【问题描述】:

调用 Remove-AzureStorageBlob Powershell

时出错
Remove-AzureStorageBlob -Container $ConName -Blob $BlobName -Context $Ctx
Remove-AzureStorageBlob : Method not found: 'Void
Microsoft.WindowsAzure.Storage.OperationContext.set_StartTime(System.DateTime)'.
At line:1 char:1
+ Remove-AzureStorageBlob -Container $ConName -Blob $BlobName -Context  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Remove-AzureStorageBlob], StorageException
    + FullyQualifiedErrorId : StorageException,Microsoft.WindowsAzure.Commands.Storage.Blob.RemoveStorageAzureBlobComm
   and

【问题讨论】:

标签: azure powershell azure-storage azure-powershell


【解决方案1】:

您的命令属于AzureRM powershell 模块。根据错误信息,你可能没有安装它,我可以在我这边重现你的问题。

要解决此问题,请按照此文档安装AzureRM powershell 模块,然后它会正常工作:https://docs.microsoft.com/en-us/powershell/azure/azurerm/install-azurerm-ps?view=azurermps-6.13.0

另外AzureRM 模块已基本弃用,我建议您使用新的Az 模块。更多详情,请参阅:https://azure.microsoft.com/en-us/blog/azure-powershell-cross-platform-az-module-replacing-azurerm/https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-1.2.0

【讨论】:

  • 最后得到以下帮助 1. 卸载 Azure Powershell MSI 2. 使用自定义 powershell 脚本卸载 AzureRM 的 AllModules 3. 安装 Az 模块 现在问题已解决。 @JoyWang - 现在接受你的回答。感谢您的帮助
【解决方案2】:

Remove-AzureStorageBlob已弃用 模块 AzureRM 的一部分。现在模块 Az 中的相同方法现在具有名称 Remove-AzStorageBlob。这个事实没有得到很好的记录,我花了一段时间才找到它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-12
    • 1970-01-01
    • 1970-01-01
    • 2015-07-21
    • 1970-01-01
    • 1970-01-01
    • 2013-02-20
    • 2018-12-30
    相关资源
    最近更新 更多