@@ -118,7 +118,10 @@ Get-AzStorageContainer -MaxCount 5 -Context $ctx | Get-AzStorageBlob -Blob "*lou
118
118
Do
119
119
{
120
120
#Retrieve blobs using the MaxCount parameter
121
- $blobs = Get-AzStorageBlob -Container $demoContainer -MaxCount $maxCount -ContinuationToken $token -Context $ctx
121
+ $blobs = Get-AzStorageBlob -Container $demoContainer `
122
+ -MaxCount $maxCount `
123
+ -ContinuationToken $token `
124
+ -Context $ctx
122
125
$blobCount = 1
123
126
124
127
#Loop through the batch
@@ -199,38 +202,40 @@ Get-AzStorageBlobContent -Container $containerName -Blob $blobName -Destination
199
202
Get-AzStorageBlob -Container $containerName -Blob $fileList -Context $ctx | Get-AzStorageBlobContent
200
203
201
204
#Use wildcard to download blobs from all containers
202
- Get-AzStorageContainer -MaxCount $maxCount -Context $ctx | Get-AzStorageBlob -Blob "louis*" | Get-AzStorageBlobContent
205
+ Get-AzStorageContainer -MaxCount $maxCount `
206
+ -Context $ctx | Get-AzStorageBlob `
207
+ -Blob "louis*" | Get-AzStorageBlobContent
203
208
```
204
209
205
210
The result displays the storage account and container names and provides a list of the files downloaded.
206
211
207
212
``` Result
208
213
AccountName: demostorageaccount, ContainerName: demo-container
209
214
210
- Name BlobType Length ContentType LastModified AccessTier IsDeleted
211
- ---- -------- ------ ----------- ------------ ---------- ---------
212
- demo-file.txt BlockBlob 222 application/octet-stream 2021-12-14 01:38:03Z Unknown False
213
- hello-world.png BlockBlob 14709 application/octet-stream 2021-12-14 01:38:03Z Unknown False
214
- hello-world2.png BlockBlob 12472 application/octet-stream 2021-12-14 01:38:03Z Unknown False
215
- hello-world3.png BlockBlob 13537 application/octet-stream 2021-12-14 01:38:03Z Unknown False
215
+ Name BlobType Length ContentType LastModified AccessTier IsDeleted
216
+ ---- -------- ------ ----------- ------------ ---------- ---------
217
+ demo-file.txt BlockBlob 222 application/octet-stream 2021-12-14 01:38:03Z Unknown False
218
+ hello-world.png BlockBlob 14709 application/octet-stream 2021-12-14 01:38:03Z Unknown False
219
+ hello-world2.png BlockBlob 12472 application/octet-stream 2021-12-14 01:38:03Z Unknown False
220
+ hello-world3.png BlockBlob 13537 application/octet-stream 2021-12-14 01:38:03Z Unknown False
216
221
217
222
AccountName: demostorageaccount, ContainerName: public-container
218
223
219
- Name BlobType Length ContentType LastModified AccessTier IsDeleted
220
- ---- -------- ------ ----------- ------------ ---------- ---------
221
- louis-armstrong.jpg BlockBlob 211482 image/jpeg 2021-12-14 18:56:03Z Unknown False
224
+ Name BlobType Length ContentType LastModified AccessTier IsDeleted
225
+ ---- -------- ------ ----------- ------------ ---------- ---------
226
+ louis-armstrong.jpg BlockBlob 211482 image/jpeg 2021-12-14 18:56:03Z Unknown False
222
227
223
228
AccountName: demostorageaccount, ContainerName: read-only-container
224
229
225
- Name BlobType Length ContentType LastModified AccessTier IsDeleted
226
- ---- -------- ------ ----------- ------------ ---------- ---------
227
- louis-jordan.jpg BlockBlob 55766 image/jpeg 2021-12-14 18:56:21Z Unknown False
230
+ Name BlobType Length ContentType LastModified AccessTier IsDeleted
231
+ ---- -------- ------ ----------- ------------ ---------- ---------
232
+ louis-jordan.jpg BlockBlob 55766 image/jpeg 2021-12-14 18:56:21Z Unknown False
228
233
229
234
AccountName: demostorageaccount, ContainerName: hidden-container
230
235
231
- Name BlobType Length ContentType LastModified AccessTier IsDeleted
232
- ---- -------- ------ ----------- ------------ ---------- ---------
233
- louis-prima.jpg BlockBlob 290651 image/jpeg 2021-12-14 18:56:45Z Unknown False
236
+ Name BlobType Length ContentType LastModified AccessTier IsDeleted
237
+ ---- -------- ------ ----------- ------------ ---------- ---------
238
+ louis-prima.jpg BlockBlob 290651 image/jpeg 2021-12-14 18:56:45Z Unknown False
234
239
```
235
240
236
241
## Manage blob properties and metadata
@@ -333,13 +338,15 @@ The example below copies the **bannerphoto.png** blob from the **photos** contai
333
338
334
339
``` azurepowershell
335
340
$blobname = "bannerphoto.png"
336
- Copy-AzStorageBlob -SrcContainer "photos" -SrcBlob $blobname -DestContainer "archive" -DestBlob $("photos/$blobname") -Context $ctx
341
+ Copy-AzStorageBlob -SrcContainer "photos" `
342
+ -SrcBlob $blobname -DestContainer "archive" `
343
+ -DestBlob $("photos/$blobname") -Context $ctx
337
344
338
345
AccountName: demostorageaccount, ContainerName: archive
339
346
340
- Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId
341
- ---- -------- ------ ----------- ------------ ---------- ------------ --------- ---------
342
- photos/bannerphoto BlockBlob 12472 image/png 2021-11-27 23:11:43Z Cool False
347
+ Name BlobType Length ContentType LastModified AccessTier IsDeleted VersionId
348
+ ---- -------- ------ ----------- ------------ ---------- --------- ---------
349
+ photos/bannerphoto BlockBlob 12472 image/png 2021-11-27 23:11:43Z Cool False
343
350
```
344
351
345
352
You can use the ` -Force ` parameter to overwrite an existing blob with the same name at the destination. This operation effectively replaces the destination blob. It also removes any uncommitted blocks and overwrites the destination blob's metadata.
@@ -348,7 +355,7 @@ You can use the `-Force` parameter to overwrite an existing blob with the same n
348
355
349
356
The resulting destination blob is a writeable blob and not a snapshot.
350
357
351
- The source blob for a copy operation may be a block blob, an append blob, a page blob, or a snapshot. If the destination blob already exists, it must be of the same blob type as the source blob. An existing destination blob will be overwritten.
358
+ The source blob for a copy operation may be a block blob, an append blob, a page blob, or a snapshot. If the destination blob already exists, it must be of the same blob type as the source blob. An existing destination blob will be overwritten.
352
359
353
360
The destination blob can't be modified while a copy operation is in progress. A destination blob can only have one outstanding copy operation. In other words, a blob can't be the destination for multiple pending copy operations.
354
361
@@ -463,7 +470,7 @@ Get-AzStorageBlob -Prefix $prefixName -IncludeDeleted -Context $ctx
463
470
464
471
AccountName: demostorageaccount, ContainerName: demo-container
465
472
466
- Name BlobType Length ContentType LastModified AccessTier IsDeleted
473
+ Name BlobType Length ContentType LastModified AccessTier IsDeleted
467
474
---- -------- ------ ----------- ------------ ---------- ---------
468
475
file.txt BlockBlob 22 application/octet-stream 2021-12-16 20:59:41Z Cool True
469
476
file2.txt BlockBlob 22 application/octet-stream 2021-12-17 00:14:24Z Cool True
0 commit comments