Powershell错误Remove-AzureStorageBlob方法未找到:'无效

时间:2019-02-10 11:16:01

标签: 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

1 个答案:

答案 0 :(得分:3)

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

enter image description here

要解决此问题,请按照以下文档安装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