调用 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
答案 0 :(得分:3)
您的命令属于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。