From c1e7eed918d94e17b6032bf22c9ba1f4da55a6c6 Mon Sep 17 00:00:00 2001 From: VigneshB-Microsoft <149112552+VigneshB-Microsoft@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:51:20 -0700 Subject: [PATCH 1/3] Update Get-AzStorageBlob.md --- .../Storage.Management/help/Get-AzStorageBlob.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md index 1fdffc38fd5e..c6c17cc4bf86 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md @@ -474,6 +474,22 @@ Accept wildcard characters: False ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +## BlobProperties + +Lists the blob properties that include (but not limited to) LastModified, CreatedOn, Metadata, ObjectReplicationDestinationPolicyId, ObjectReplicationSourceProperties, BlobType, CopyCompletedOn, CopyStatusDescription, CopyProgress, CopyStatus, BlobCopyStatus, IsIncrementalCopy, DestinationSnapshot, LeaseDuration, LeaseState, LeaseStatus, ContentLength, ContentType, ETag, ContentHash, ContentEncoding, ContentDisposition, ContentLanguage, CacheControl, BlobSequenceNumber, AcceptRanges, BlobCommittedBlockCount, IsServerEncrypted, EncryptionKeySha256, EncryptionScope, AccessTier, AccessTierInferred, ArchiveStatus, AccessTierChangedOn, VersionId, IsLatestVersion, TagCount, ExpiresOn, IsSealed, RehydratePriority, LastAccessed, ImmutabilityPolicy, HasLegalHold + +## EXAMPLE + +```powershell +(Get-AzStorageBlob -Container "ContainerName" -Blob "blob" -Context $ctx).BlobProperties.ImmutabilityPolicy +``` + +```output +ExpiresOn PolicyMode +--------- ---------- +9/17/2024 2:49:32 AM +00:00 Unlocked +``` + ## INPUTS ### System.String From 121f6dbbfd9d82d8fc5a922c065d30420c0dc3af Mon Sep 17 00:00:00 2001 From: VigneshB-Microsoft <149112552+VigneshB-Microsoft@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:18:40 -0700 Subject: [PATCH 2/3] Update Get-AzStorageBlob.md --- .../help/Get-AzStorageBlob.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md index c6c17cc4bf86..13f03476bd97 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md @@ -201,6 +201,20 @@ testblob BlockBlob 2097152 application/octet-stream 20 This command gets a single blob with blob tag condition. The cmdlet will only success when the blob contains a tag with name "tag1" and value "value1", else the cmdlet will fail with error code 412. +### Example 10: Get blob properties +```powershell +(Get-AzStorageBlob -Container "ContainerName" -Blob "blob" -Context $ctx).BlobProperties.ImmutabilityPolicy +``` + +```output +ExpiresOn PolicyMode +--------- ---------- +9/17/2024 2:49:32 AM +00:00 Unlocked +``` + +This example command gets the immutability property of a single blob. BlobProperties cmdlet gets a detailed list of properties for a single blob. +For a list of multiple blobs, use the cmdlet without blob name and use **ListBlobProperties** cmdlet for a better performance. + ## PARAMETERS ### -Blob @@ -474,22 +488,6 @@ Accept wildcard characters: False ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). -## BlobProperties - -Lists the blob properties that include (but not limited to) LastModified, CreatedOn, Metadata, ObjectReplicationDestinationPolicyId, ObjectReplicationSourceProperties, BlobType, CopyCompletedOn, CopyStatusDescription, CopyProgress, CopyStatus, BlobCopyStatus, IsIncrementalCopy, DestinationSnapshot, LeaseDuration, LeaseState, LeaseStatus, ContentLength, ContentType, ETag, ContentHash, ContentEncoding, ContentDisposition, ContentLanguage, CacheControl, BlobSequenceNumber, AcceptRanges, BlobCommittedBlockCount, IsServerEncrypted, EncryptionKeySha256, EncryptionScope, AccessTier, AccessTierInferred, ArchiveStatus, AccessTierChangedOn, VersionId, IsLatestVersion, TagCount, ExpiresOn, IsSealed, RehydratePriority, LastAccessed, ImmutabilityPolicy, HasLegalHold - -## EXAMPLE - -```powershell -(Get-AzStorageBlob -Container "ContainerName" -Blob "blob" -Context $ctx).BlobProperties.ImmutabilityPolicy -``` - -```output -ExpiresOn PolicyMode ---------- ---------- -9/17/2024 2:49:32 AM +00:00 Unlocked -``` - ## INPUTS ### System.String From 8cb4d9e528afb917a08a26277aaffc673b70c8d5 Mon Sep 17 00:00:00 2001 From: VigneshB-Microsoft <149112552+VigneshB-Microsoft@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:45:27 -0700 Subject: [PATCH 3/3] Update Get-AzStorageBlob.md Made modifications to the PR based on the comments --- src/Storage/Storage.Management/help/Get-AzStorageBlob.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md index 13f03476bd97..240d2c39f62b 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md @@ -201,9 +201,10 @@ testblob BlockBlob 2097152 application/octet-stream 20 This command gets a single blob with blob tag condition. The cmdlet will only success when the blob contains a tag with name "tag1" and value "value1", else the cmdlet will fail with error code 412. -### Example 10: Get blob properties +### Example 10: Get blob properties (example: ImmutabilityPolicy) of a single blob ```powershell -(Get-AzStorageBlob -Container "ContainerName" -Blob "blob" -Context $ctx).BlobProperties.ImmutabilityPolicy +$blobProperties = (Get-AzStorageBlob -Container "ContainerName" -Blob "blob" -Context $ctx).BlobProperties +$blobProperties.ImmutabilityPolicy ``` ```output @@ -212,8 +213,8 @@ ExpiresOn PolicyMode 9/17/2024 2:49:32 AM +00:00 Unlocked ``` -This example command gets the immutability property of a single blob. BlobProperties cmdlet gets a detailed list of properties for a single blob. -For a list of multiple blobs, use the cmdlet without blob name and use **ListBlobProperties** cmdlet for a better performance. +This example command gets the immutability property of a single blob. You can get a detailed list of blob prTooperties from the **BlobProperties** property, including but not limited to: LastModified, ContentLength, ContentHash, BlobType, LeaseState, AccessTier, ETag, ImmutabilityPolicy, etc... +To list multiple blobs (execute the cmdlet without blob name), use **ListBlobProperties.Properties** instead of **BlobProperties** for better performance. ## PARAMETERS