Martin Brandl
Martin Brandl

Reputation: 58931

Get-AzureStorageBlob without -blob parameter returns images twice

It seems like the Get-AzureStorageBlob cmdlet returns two items with the same name (but different ContentType) when I omit the -blob parameter (to retrieve all images):

Now when I use the Where-Object cmdlet to retrieve a specific blob by name I get two blobs back:

enter image description here

If I instead specify the blob name in the Get-AzureStorageBlob cmdlet, I only get one file back:

enter image description here

Is this behavior desired? Also in the Azure Storage Explorer I only see one item.

This is how the Request without the -blob parameter looks like:

GET https://XXX.blob.core.windows.net/XXX?restype=container&comp=list&prefix=&maxresults=5000&include=snapshots%2Cmetadata%2Ccopy HTTP/1.1
x-ms-version: 2017-04-17
x-ms-client-request-id: Azure-Storage-PowerShell-XXX
User-Agent: Azure-Storage/8.5.0 (.NET CLR 4.0.30319.42000; Win32NT 10.0.15063.0) AzurePowershell/v5.0.0
x-ms-date: Fri, 16 Mar 2018 08:32:56 GMT
Authorization: SharedKey XXX
Host: XXX.blob.core.windows.net

Upvotes: 2

Views: 336

Answers (1)

Fabrizio Accatino
Fabrizio Accatino

Reputation: 2292

Verify case. -Blob items are case-sensitive. PowerShell where -eq ... is not case sensitive.

Perhaps the two JPG of the first example differ only in some characters case.

Upvotes: 7

Related Questions