有一个Remove-AzureStorageBlob命令。但没有等效的Remove-AzureRMStorageBlob命令。
答案 0 :(得分:1)
在Azure中,没有命令Remove-AzureRMStorageBlob,在ARM PowerShell中,我们仍然使用 Remove-AzureStorageBlob 命令,这是我的测试:
PS > $rg = "jason"
PS > $sn = "jason999"
PS > $con = "jason"
PS > $key = "5RPye6dEett3ZwWPr+JuB3FVx59dmfOXq/NfvgFlUNAiBjoKkm3w+Yu5w/x6Hmxg6aOYDGrOuxOlXzQZ1hViLQ=="
PS > $ctx = New-AzureStorageContext -StorageAccountName $sn -StorageAccountKey $key
PS > $ctx
StorageAccountName : jason999
BlobEndPoint : https://jason999.blob.core.windows.net/
TableEndPoint : https://jason999.table.core.windows.net/
QueueEndPoint : https://jason999.queue.core.windows.net/
FileEndPoint : https://jason999.file.core.windows.net/
Context : Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext
Name :
StorageAccount : BlobEndpoint=https://jason999.blob.core.windows.net/;QueueEndpoint=https://jason999.queue.core.win
dows.net/;TableEndpoint=https://jason999.table.core.windows.net/;FileEndpoint=https://jason999.fil
e.core.windows.net/;AccountName=jason999;AccountKey=[key hidden]
EndPointSuffix : core.windows.net/
PS > Get-AzureStorageBlob -Blob * -Container $con -Context $ctx
ICloudBlob : Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
BlobType : BlockBlob
Length : 26645
ContentType : image/png
LastModified : 1/18/2017 12:59:11 AM +00:00
SnapshotTime :
ContinuationToken :
Context : Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext
Name : 113.PNG
PS > Get-AzureStorageBlob -Blob * -Container $con -Context $ctx | Remove-AzureStorageBlob
PS > Get-AzureStorageBlob -Blob * -Container $con -Context $ctx
PS >
答案 1 :(得分:0)
没有名为Remove-AzureRMStorageBlob的命令,因为旧版Azure存储帐户和ARM Azure存储帐户的数据平面API完全相同。传统Azure存储帐户与ARM Azure存储帐户之间的唯一区别在于控制平面(帐户创建,帐户删除和帐户级元数据/属性管理)。