azure - Powershell 错误Remove-AzureStorageBlob 未找到方法 : 'Void

标签 azure powershell azure-storage azure-powershell

enter image description here enter image description here

调用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

最佳答案

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

enter image description here

要解决此问题,请按照此文档安装 AzureRM powershell 模块,然后它将正常工作:https://learn.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://learn.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-1.2.0 .

关于azure - Powershell 错误Remove-AzureStorageBlob 未找到方法 : 'Void,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54615806/

相关文章:

powershell - 超时 Get-WMIObject cmdlet

windows - 如何找到正在运行的计划任务的进程ID?

azure - OpenID Connect 使用 Office 365 和 spring security 登录

asp.net - SignalR 协商失败(网关错误)

powershell - 获取 msg 文件的内容到字符串中

azure - Azure 上的 NVMe SSD

azure - 如何使用 PowerShell 在 Azure 存储容器内创建文件夹结构

python - 如何在 Azure 机器学习管道中对使用 U-SQL 脚本生成的结果运行 Python 脚本?

azure - 将应用程序洞察与 Power BI 集成时数据未更新

c# - 获取 Azure Blob 存储中的图像