@@ -66,8 +66,13 @@ public class NewAzureStorageBlobInventoryPolicyRuleCommand : StorageAccountBaseC
6666            ParameterSetName  =  BlobRuleParameterSet , 
6767            HelpMessage  =  "Specifies the fields and properties of the Blob object to be included in the inventory. Valid values include: "  + 
6868                            "Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, Expiry-Time, hdi_isfolder, Owner, "  + 
69-                             "Group, Permissions, Acl, Metadata, LastAccessTime, AccessTierInferred, Tags. 'Name' is a required schemafield. "  +  
69+                             "Group, Permissions, Acl, Metadata, LastAccessTime, AccessTierInferred, Tags, Etag, Content-Type, Content-Encoding, Content-Language, Content-CRC64, "  + 
70+                             "Cache-Control, Content-Disposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, RemainingRetentionDays, ImmutabilityPolicyUntilDate"  + 
71+                             "ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256 "  + 
72+                             "RehydratePriority, ArchiveStatus, x-ms-blob-sequence-number, EncryptionScope, IncrementalCopy, DeletionId, DeletedTime, TagCount. "  +  
73+                             "'Name' is a required schemafield. "  +  
7074                            "Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl' are valid only for Hns enabled accounts.'Tags' field is only valid for non Hns accounts."  + 
75+                             "'Tags, TagCount' field is only valid for non Hns accounts. "  +  
7176                            "If specify '-IncludeSnapshot', will include 'Snapshot'  in the inventory.  If specify '-IncludeBlobVersion', will include 'VersionId, 'IsCurrentVersion' in the inventory." ) ] 
7277        [ ValidateSet ( BlobInventoryPolicyBlobSchemaField . Name , 
7378            BlobInventoryPolicyBlobSchemaField . CreationTime , 
@@ -87,15 +92,47 @@ public class NewAzureStorageBlobInventoryPolicyRuleCommand : StorageAccountBaseC
8792            BlobInventoryPolicyBlobSchemaField . LastAccessTime , 
8893            BlobInventoryPolicyBlobSchemaField . AccessTierInferred , 
8994            BlobInventoryPolicyBlobSchemaField . Tags , 
95+             BlobInventoryPolicyBlobSchemaField . Etag , 
96+             BlobInventoryPolicyBlobSchemaField . ContentType , 
97+             BlobInventoryPolicyBlobSchemaField . ContentEncoding , 
98+             BlobInventoryPolicyBlobSchemaField . ContentLanguage , 
99+             BlobInventoryPolicyBlobSchemaField . ContentCRC64 , 
100+             BlobInventoryPolicyBlobSchemaField . CacheControl , 
101+             BlobInventoryPolicyBlobSchemaField . ContentDisposition , 
102+             BlobInventoryPolicyBlobSchemaField . LeaseStatus , 
103+             BlobInventoryPolicyBlobSchemaField . LeaseState , 
104+             BlobInventoryPolicyBlobSchemaField . LeaseDuration , 
105+             BlobInventoryPolicyBlobSchemaField . ServerEncrypted , 
106+             BlobInventoryPolicyBlobSchemaField . Deleted , 
107+             BlobInventoryPolicyBlobSchemaField . RemainingRetentionDays , 
108+             BlobInventoryPolicyBlobSchemaField . ImmutabilityPolicyUntilDate , 
109+             BlobInventoryPolicyBlobSchemaField . ImmutabilityPolicyMode , 
110+             BlobInventoryPolicyBlobSchemaField . LegalHold , 
111+             BlobInventoryPolicyBlobSchemaField . CopyId , 
112+             BlobInventoryPolicyBlobSchemaField . CopyStatus , 
113+             BlobInventoryPolicyBlobSchemaField . CopySource , 
114+             BlobInventoryPolicyBlobSchemaField . CopyProgress , 
115+             BlobInventoryPolicyBlobSchemaField . CopyCompletionTime , 
116+             BlobInventoryPolicyBlobSchemaField . CopyStatusDescription , 
117+             BlobInventoryPolicyBlobSchemaField . CustomerProvidedKeySha256 , 
118+             BlobInventoryPolicyBlobSchemaField . RehydratePriority , 
119+             BlobInventoryPolicyBlobSchemaField . ArchiveStatus , 
120+             BlobInventoryPolicyBlobSchemaField . xmsblobsequencenumber , 
121+             BlobInventoryPolicyBlobSchemaField . EncryptionScope , 
122+             BlobInventoryPolicyBlobSchemaField . IncrementalCopy , 
123+             BlobInventoryPolicyBlobSchemaField . DeletionId , 
124+             BlobInventoryPolicyBlobSchemaField . DeletedTime , 
125+             BlobInventoryPolicyBlobSchemaField . TagCount , 
90126            IgnoreCase  =  true ) ] 
91127        [ ValidateNotNullOrEmpty ] 
92128        public  string [ ]  BlobSchemaField  {  get ;  set ;  } 
93129
94130        [ Parameter ( Mandatory  =  true , 
95131            ParameterSetName  =  ContainerRuleParameterSet , 
96132            HelpMessage  =  "Specifies the fields and properties of the container object to be included in the inventory. Valid values include: "  + 
97-                             "Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold. "  +  
98-                             "'Name' is a required schemafield." ) ] 
133+                             "Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, "  + 
134+                             "Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, Deleted, Version, "  + 
135+                             "DeletedTime, RemainingRetentionDays. 'Name' is a required schemafield." ) ] 
99136        [ ValidateSet ( BlobInventoryPolicyContainerSchemaField . Name , 
100137            BlobInventoryPolicyContainerSchemaField . LastModified , 
101138            BlobInventoryPolicyContainerSchemaField . Metadata , 
@@ -105,6 +142,14 @@ public class NewAzureStorageBlobInventoryPolicyRuleCommand : StorageAccountBaseC
105142            BlobInventoryPolicyContainerSchemaField . PublicAccess , 
106143            BlobInventoryPolicyContainerSchemaField . HasImmutabilityPolicy , 
107144            BlobInventoryPolicyContainerSchemaField . HasLegalHold , 
145+             BlobInventoryPolicyContainerSchemaField . Etag , 
146+             BlobInventoryPolicyContainerSchemaField . DefaultEncryptionScope , 
147+             BlobInventoryPolicyContainerSchemaField . DenyEncryptionScopeOverride , 
148+             BlobInventoryPolicyContainerSchemaField . ImmutableStorageWithVersioningEnabled , 
149+             BlobInventoryPolicyContainerSchemaField . Deleted , 
150+             BlobInventoryPolicyContainerSchemaField . Version , 
151+             BlobInventoryPolicyContainerSchemaField . DeletedTime , 
152+             BlobInventoryPolicyContainerSchemaField . RemainingRetentionDays , 
108153            IgnoreCase  =  true ) ] 
109154        [ ValidateNotNullOrEmpty ] 
110155        public  string [ ]  ContainerSchemaField  {  get ;  set ;  } 
@@ -120,31 +165,42 @@ public class NewAzureStorageBlobInventoryPolicyRuleCommand : StorageAccountBaseC
120165        public  string [ ]  BlobType  {  get ;  set ;  } 
121166
122167        [ Parameter ( Mandatory  =  false , 
123-             HelpMessage  =  "Sets an array of strings for blob prefixes to be matched.. " ) ] 
168+             HelpMessage  =  "Sets an array of strings for blob prefixes to be matched." ) ] 
124169        [ ValidateNotNullOrEmpty ] 
125170        public  string [ ]  PrefixMatch  {  get ;  set ;  } 
126171
172+         [ Parameter ( Mandatory  =  false , 
173+             HelpMessage  =  "Sets an array of strings with maximum 10 blob prefixes to be excluded from the inventory." ) ] 
174+         [ ValidateNotNullOrEmpty ] 
175+         public  string [ ]  ExcludePrefix  {  get ;  set ;  } 
176+ 
127177        [ Parameter ( Mandatory  =  false , 
128178            ParameterSetName  =  BlobRuleParameterSet , 
129-             HelpMessage  =  "The rule is disabled if set it. " ) ] 
179+             HelpMessage  =  "Includes blob snapshots in blob inventory " ) ] 
130180        public  SwitchParameter  IncludeSnapshot  {  get ;  set ;  } 
131181
132182        [ Parameter ( Mandatory  =  false , 
133183            ParameterSetName  =  BlobRuleParameterSet , 
134-             HelpMessage  =  "The rule is disabled if set it ." ) ] 
184+             HelpMessage  =  "Includes blob versions in blob inventory ." ) ] 
135185        public  SwitchParameter  IncludeBlobVersion  {  get ;  set ;  } 
136186
187+         [ Parameter ( Mandatory  =  false , 
188+             ParameterSetName  =  BlobRuleParameterSet , 
189+             HelpMessage  =  "Includes deleted blob in blob inventory. When include delete blob, for ContainerSchemaFields, must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For BlobSchemaFields, on HNS enabled storage accounts, must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays', and on Hns disabled accounts must include 'Deleted and RemainingRetentionDays', else they must be excluded." ) ] 
190+         public  SwitchParameter  IncludeDeleted  {  get ;  set ;  } 
191+ 
137192        public  override  void  ExecuteCmdlet ( ) 
138193        { 
139194            base . ExecuteCmdlet ( ) ; 
140195
141196            PSBlobInventoryPolicyDefinition  definition  =  new  PSBlobInventoryPolicyDefinition ( ) ; 
142-             if  ( this . BlobType  !=  null  ||  this . PrefixMatch  !=  null  ||  this . IncludeSnapshot . IsPresent  ||  this . IncludeBlobVersion . IsPresent ) 
197+             if  ( this . BlobType  !=  null  ||  this . PrefixMatch  !=  null  ||  this . ExcludePrefix   !=   null   ||   this . IncludeSnapshot . IsPresent  ||  this . IncludeBlobVersion . IsPresent   ||   this . IncludeDeleted . IsPresent ) 
143198            { 
144199                definition . Filters  =  new  PSBlobInventoryPolicyFilter ( ) 
145200                { 
146201                    BlobTypes  =  NormalizeStringArray < AzureBlobType > ( this . BlobType ) , 
147-                     PrefixMatch  =  this . PrefixMatch 
202+                     PrefixMatch  =  this . PrefixMatch , 
203+                     ExcludePrefix  =  this . ExcludePrefix 
148204                } ; 
149205                if  ( this . IncludeBlobVersion . IsPresent ) 
150206                { 
@@ -154,6 +210,10 @@ public override void ExecuteCmdlet()
154210                { 
155211                    definition . Filters . IncludeSnapshots  =  true ; 
156212                } 
213+                 if  ( this . IncludeDeleted . IsPresent ) 
214+                 { 
215+                     definition . Filters . IncludeDeleted  =  true ; 
216+                 } 
157217            } 
158218            definition . Format  =  NormalizeString < BlobInventoryPolicyRuleFormat > ( this . Format ) ; 
159219            definition . Schedule  =  NormalizeString < BlobInventoryPolicyRuleSchedule > ( this . Schedule ) ; 
@@ -218,6 +278,14 @@ protected struct BlobInventoryPolicyContainerSchemaField
218278            public  const  string  PublicAccess  =  "PublicAccess" ; 
219279            public  const  string  HasImmutabilityPolicy  =  "HasImmutabilityPolicy" ; 
220280            public  const  string  HasLegalHold  =  "HasLegalHold" ; 
281+             public  const  string  Etag  =  "Etag" ; 
282+             public  const  string  DefaultEncryptionScope  =  "DefaultEncryptionScope" ; 
283+             public  const  string  DenyEncryptionScopeOverride  =  "DenyEncryptionScopeOverride" ; 
284+             public  const  string  ImmutableStorageWithVersioningEnabled  =  "ImmutableStorageWithVersioningEnabled" ; 
285+             public  const  string  Deleted  =  "Deleted" ; 
286+             public  const  string  Version  =  "Version" ; 
287+             public  const  string  DeletedTime  =  "DeletedTime" ; 
288+             public  const  string  RemainingRetentionDays  =  "RemainingRetentionDays" ; 
221289        } 
222290
223291        protected  struct  BlobInventoryPolicyBlobSchemaField 
@@ -243,6 +311,37 @@ protected struct BlobInventoryPolicyBlobSchemaField
243311            public  const  string  LastAccessTime  =  "LastAccessTime" ; 
244312            public  const  string  AccessTierInferred  =  "AccessTierInferred" ; 
245313            public  const  string  Tags  =  "Tags" ; 
314+             public  const  string  Etag  =  "Etag" ; 
315+             public  const  string  ContentType  =  "Content-Type" ; 
316+             public  const  string  ContentEncoding  =  "Content-Encoding" ; 
317+             public  const  string  ContentLanguage  =  "Content-Language" ; 
318+             public  const  string  ContentCRC64  =  "Content-CRC64" ; 
319+             public  const  string  CacheControl  =  "Cache-Control" ; 
320+             public  const  string  ContentDisposition  =  "Content-Disposition" ; 
321+             public  const  string  LeaseStatus  =  "LeaseStatus" ; 
322+             public  const  string  LeaseState  =  "LeaseState" ; 
323+             public  const  string  LeaseDuration  =  "LeaseDuration" ; 
324+             public  const  string  ServerEncrypted  =  "ServerEncrypted" ; 
325+             public  const  string  Deleted  =  "Deleted" ; 
326+             public  const  string  RemainingRetentionDays  =  "RemainingRetentionDays" ; 
327+             public  const  string  ImmutabilityPolicyUntilDate  =  "ImmutabilityPolicyUntilDate" ; 
328+             public  const  string  ImmutabilityPolicyMode  =  "ImmutabilityPolicyMode" ; 
329+             public  const  string  LegalHold  =  "LegalHold" ; 
330+             public  const  string  CopyId  =  "CopyId" ; 
331+             public  const  string  CopyStatus  =  "CopyStatus" ; 
332+             public  const  string  CopySource  =  "CopySource" ; 
333+             public  const  string  CopyProgress  =  "CopyProgress" ; 
334+             public  const  string  CopyCompletionTime  =  "CopyCompletionTime" ; 
335+             public  const  string  CopyStatusDescription  =  "CopyStatusDescription" ; 
336+             public  const  string  CustomerProvidedKeySha256  =  "CustomerProvidedKeySha256" ; 
337+             public  const  string  RehydratePriority  =  "RehydratePriority" ; 
338+             public  const  string  ArchiveStatus  =  "ArchiveStatus" ; 
339+             public  const  string  xmsblobsequencenumber  =  "x-ms-blob-sequence-number" ; 
340+             public  const  string  EncryptionScope  =  "EncryptionScope" ; 
341+             public  const  string  IncrementalCopy  =  "IncrementalCopy" ; 
342+             public  const  string  DeletionId  =  "DeletionId" ; 
343+             public  const  string  DeletedTime  =  "DeletedTime" ; 
344+             public  const  string  TagCount  =  "TagCount" ; 
246345        } 
247346
248347        protected  struct  BlobInventoryPolicyRuleSchedule 
0 commit comments