Closed valdearg closed 5 years ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage
@valdearg
In Get-AzStorageBlob, the value of -Blob
is taken as a WildcardPattern. So []
will be taken as a pattern.
To workaround this, you can just use [[]
and []]
to replace [
and ]
, it works on my machine with latest Az.Storage module.
For you case, the command will be :
Get-AzStorageBlob -Blob "leavers_001 [[]1[]].jpg_conflicted" -Container $Dest_ContainerName -Context $Dest_context
Let me know if it works for you.
@blueww
Thank you for your help with this, I can confirm that this absolutely resolves the issue.
I'll take a look at some suitable regex or something to replace the square brackets, this should resolve the issue.
Thanks again!
@valdearg Thanks for the confirm! I will close the issue. Feel free to contact us if need any other assistance.
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.
For those who would like to use this in PowerShell:
$modifiedBlobName = $blobName -replace '(\[|\])', '[$1]'
Description
If you have a blob with a [ or ] (most likely other characters also) the Get-AzStorageBlob will return no results.
I've previously had this issue with the Move-Item where I needed to add in a '`' before each character to move the file. I've tried this in this situation but doesn't appear to be working in this situation.
Steps to reproduce
Environment data
Module versions
Debug output
Error output