diff --git a/CHANGELOG.md b/CHANGELOG.md index 908a41f..3b27c28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ The format is based on and uses the types of changes according to [Keep a Change ## [Unreleased] +### Added + +- ETag validation for Update- & Remove-AzDataTableEntity ([#58](https://github.com/PalmEmanuel/AzBobbyTables/issues/58)) + +### Fixed + +- Missing examples of Remove-AzDataTableEntity + ## [3.1.3] - 2024-01-20 ### Added diff --git a/docs/help/Remove-AzDataTableEntity.md b/docs/help/Remove-AzDataTableEntity.md index db29441..b5a37c2 100644 --- a/docs/help/Remove-AzDataTableEntity.md +++ b/docs/help/Remove-AzDataTableEntity.md @@ -1,103 +1,136 @@ ---- -external help file: AzBobbyTables.PS.dll-Help.xml -Module Name: AzBobbyTables -online version: -schema: 2.0.0 ---- - -# Remove-AzDataTableEntity - -## SYNOPSIS - -Remove one or more entities from an Azure Table. - -## SYNTAX - -``` -Remove-AzDataTableEntity -Context -Entity - [] -``` - -## DESCRIPTION - -Remove one or more entities from an Azure Table, as an array of either Hashtables or PSObjects, based on PartitionKey and RowKey. - -## EXAMPLES - -### Example 1 - -```powershell -PS C:\> $Entity = @{ PartitionKey = 'Example'; RowKey = '1' } -PS C:\> Remove-AzDataTableEntity -Entity $Entity -TableName $TableName -StorageAccountName $Name -StorageAccountKey $Key -``` - -Remove the entity with PartitionKey "Example" and RowKey "1", using the storage account name and an access key. - -### Example 2 - -```powershell -PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby' and LastName eq 'Tables'" -TableName $TableName -ConnectionString $ConnectionString -PS C:\> Remove-AzDataTableEntity -Entity $UserEntity -TableName $TableName -StorageAccountName $Name -StorageAccountKey $Key -``` - -Get the user "Bobby Tables" from the table using a connection string, then remove the user using the storage account name and an access key. - -### Example 3 - -```powershell -PS C:\> $Users = Get-AzDataTableEntity -Filter "LastName eq 'Tables'" -TableName $TableName -ConnectionString $ConnectionString -PS C:\> Remove-AzDataTableEntity -Entity $Users -TableName $TableName -StorageAccountName $Name -StorageAccountKey $Key -``` - -Gets all users with the last name "Tables" from the table using a connection string, then removes the users using the storage account name and an access key. - -## PARAMETERS - -### -Context - -A context object created by New-AzDataTableContext, with authentication information for the table to operate on. - -```yaml -Type: AzDataTableContext -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Entity - -The entities to remove from the table. - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Collections.Hashtable[] or System.Management.Automation.PSObject[] - -This cmdlet takes either an array of hashtables or psobjects as input to the Entity parameter, which can also be provided through the pipeline. - -## OUTPUTS - -### None - -## NOTES - -## RELATED LINKS +--- +external help file: AzBobbyTables.PS.dll-Help.xml +Module Name: AzBobbyTables +online version: +schema: 2.0.0 +--- + +# Remove-AzDataTableEntity + +## SYNOPSIS + +Remove one or more entities from an Azure Table. + +## SYNTAX + +``` +Remove-AzDataTableEntity -Context -Entity [-Force] + [] +``` + +## DESCRIPTION + +Remove one or more entities from an Azure Table, as an array of either Hashtables or PSObjects, based on PartitionKey and RowKey. + +## EXAMPLES + +### Example 1 + +```powershell +PS C:\> $Context = New-AzDataTableContext -TableName $TableName -StorageAccountName $Name -StorageAccountKey $Key +PS C:\> $Entity = @{ PartitionKey = 'Example'; RowKey = '1' } +PS C:\> Remove-AzDataTableEntity -Entity $Entity -TableName $TableName -Context $Context +``` + +Remove the entity with PartitionKey "Example" and RowKey "1", using the storage account name and an access key. + +### Example 2 + +```powershell +PS C:\> $Context = New-AzDataTableContext -TableName $TableName -ConnectionString $ConnectionString +PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby' and LastName eq 'Tables'" -Context $Context +PS C:\> Remove-AzDataTableEntity -Entity $UserEntity -Context $Context +``` + +Get the user "Bobby Tables" from the table using a connection string, then remove the user using the storage account name and an access key. + +### Example 3 + +```powershell +PS C:\> $Context = New-AzDataTableContext -StorageAccountName $StorageName -TableName $TableName -ManagedIdentity +PS C:\> $Users = Get-AzDataTableEntity -Filter "LastName eq 'Tables'" -Context $Context +PS C:\> Remove-AzDataTableEntity -Entity $Users -Context $Context +``` + +Gets all users with the last name "Tables" from the table using a system-assigned managed identity, then removes the users. + +### Example 4 + +```powershell +PS C:\> $Context = New-AzDataTableContext -TableName $TableName -ConnectionString $ConnectionString +PS C:\> $Users = Get-AzDataTableEntity -Filter "LastName eq 'Tables'" -Context $Context +PS C:\> # Imagine that the users are updated somewhere else +PS C:\> Remove-AzDataTableEntity -Entity $Users -Context $Context +PS C:\> # ERROR - The ETag of Users do not match +PS C:\> Remove-AzDataTableEntity -Entity $Users -Context $Context -Force +PS C:\> # OK - The -Force switch overrides ETag validation +``` + +Force remove all users with the last name Tables, overriding ETag validation. + +## PARAMETERS + +### -Context + +A context object created by New-AzDataTableContext, with authentication information for the table to operate on. + +```yaml +Type: AzDataTableContext +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Entity + +The entities to remove from the table. + +```yaml +Type: Object[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Force + +Skips ETag validation and remove entity even if it has changed. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Collections.Hashtable[] or System.Management.Automation.PSObject[] + +This cmdlet takes either an array of hashtables or psobjects as input to the Entity parameter, which can also be provided through the pipeline. + +## OUTPUTS + +### None + +## NOTES + +## RELATED LINKS diff --git a/docs/help/Update-AzDataTableEntity.md b/docs/help/Update-AzDataTableEntity.md index a5be554..b005e28 100644 --- a/docs/help/Update-AzDataTableEntity.md +++ b/docs/help/Update-AzDataTableEntity.md @@ -1,90 +1,121 @@ ---- -external help file: AzBobbyTables.PS.dll-Help.xml -Module Name: AzBobbyTables -online version: -schema: 2.0.0 ---- - -# Update-AzDataTableEntity - -## SYNOPSIS - -Update one or more entities in an Azure Table. - -## SYNTAX - -``` -Update-AzDataTableEntity -Context -Entity - [] -``` - -## DESCRIPTION - -Update one or more entities already existing in an Azure Table, as an array of either Hashtables or PSObjects. - -For adding and overwriting, also see the command Add-AzDataTableEntity. - -The PartitionKey and RowKey cannot be updated. - -## EXAMPLES - -### Example 1 - -```powershell -PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby'" -TableName $TableName -ConnectionString $ConnectionString -PS C:\> $UserEntity['LastName'] = 'Tables' -PS C:\> Update-AzDataTableEntity -Entity $UserEntity -TableName $TableName -ConnectionString $ConnectionString -``` - -Update the last name of the user "Bobby" to "Tables" using a connection string. - -## PARAMETERS - -### -Context - -A context object created by New-AzDataTableContext, with authentication information for the table to operate on. - -```yaml -Type: AzDataTableContext -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Entity - -The entities to update in the table. - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Collections.Hashtable[] or System.Management.Automation.PSObject[] - -This cmdlet takes either an array of hashtables or psobjects as input to the Entity parameter, which can also be provided through the pipeline. - -## OUTPUTS - -### None - -## NOTES - -## RELATED LINKS +--- +external help file: AzBobbyTables.PS.dll-Help.xml +Module Name: AzBobbyTables +online version: +schema: 2.0.0 +--- + +# Update-AzDataTableEntity + +## SYNOPSIS + +Update one or more entities in an Azure Table. + +## SYNTAX + +``` +Update-AzDataTableEntity -Context -Entity [-Force] + [] +``` + +## DESCRIPTION + +Update one or more entities already existing in an Azure Table, as an array of either Hashtables or PSObjects. + +For adding and overwriting, also see the command Add-AzDataTableEntity. + +The PartitionKey and RowKey cannot be updated. + +## EXAMPLES + +### Example 1 + +```powershell +PS C:\> $Context = New-AzDataTableContext -TableName $TableName -ConnectionString $ConnectionString +PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby'" -Context $Context +PS C:\> $UserEntity['LastName'] = 'Tables' +PS C:\> Update-AzDataTableEntity -Entity $UserEntity -Context $Context +``` + +Update the last name of the user "Bobby" to "Tables" using a connection string. + +### Example 2 + +```powershell +PS C:\> $Context = New-AzDataTableContext -TableName $TableName -ConnectionString $ConnectionString +PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby'" -Context $Context +PS C:\> $UserEntity['LastName'] = 'Tables' +PS C:\> # Imagine that the user is updated somewhere else +PS C:\> Update-AzDataTableEntity -Entity $UserEntity -Context $Context +PS C:\> # ERROR - The ETag of UserEntity does not match +PS C:\> Update-AzDataTableEntity -Entity $UserEntity -Context $Context -Force +``` + +Force update the last name of the user "Bobby" to "Tables" using a connection string, overriding ETag validation. + +## PARAMETERS + +### -Context + +A context object created by New-AzDataTableContext, with authentication information for the table to operate on. + +```yaml +Type: AzDataTableContext +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Entity + +The entities to update in the table. + +```yaml +Type: Object[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Force + +Skips ETag validation and updates entity even if it has changed. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Collections.Hashtable[] or System.Management.Automation.PSObject[] + +This cmdlet takes either an array of hashtables or psobjects as input to the Entity parameter, which can also be provided through the pipeline. + +## OUTPUTS + +### None + +## NOTES + +## RELATED LINKS diff --git a/source/AzBobbyTables.Core/AzDataTableService.cs b/source/AzBobbyTables.Core/AzDataTableService.cs index d3c58ae..ffe0062 100644 --- a/source/AzBobbyTables.Core/AzDataTableService.cs +++ b/source/AzBobbyTables.Core/AzDataTableService.cs @@ -166,8 +166,9 @@ public void RemoveTable() /// Remove one or more entities from a table. /// /// The list of entities to remove, with PartitionKey and RowKey set. + /// Whether or not to validate that the ETag is the same and the item has not changed. /// The result of the transaction. - public void RemoveEntitiesFromTable(IEnumerable hashtables) + public void RemoveEntitiesFromTable(IEnumerable hashtables, bool validateEtag = true) { try { @@ -175,10 +176,17 @@ public void RemoveEntitiesFromTable(IEnumerable hashtables) var entities = hashtables.Select(r => { - return new TableEntity(r["PartitionKey"].ToString(), r["RowKey"].ToString()); + TableEntity entity = new() + { + PartitionKey = r["PartitionKey"].ToString(), + RowKey = r["RowKey"].ToString(), + ETag = r.ContainsKey("ETag") ? new(r["ETag"].ToString()) : default, + Timestamp = r.ContainsKey("Timestamp") ? (DateTimeOffset?)r["Timestamp"] : default + }; + return entity; }); - transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.Delete, e))); + transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.Delete, e, validateEtag ? e.ETag : default))); SubmitTransaction(transactions); } @@ -192,8 +200,9 @@ public void RemoveEntitiesFromTable(IEnumerable hashtables) /// Remove one or more entities from a table. /// /// The list of entities to remove, with PartitionKey and RowKey set. + /// Whether or not to validate that the ETag is the same and the item has not changed. /// The result of the transaction. - public void RemoveEntitiesFromTable(IEnumerable psobjects) + public void RemoveEntitiesFromTable(IEnumerable psobjects, bool validateEtag = true) { try { @@ -201,13 +210,25 @@ public void RemoveEntitiesFromTable(IEnumerable psobjects) var entities = psobjects.Select(e => { - return new TableEntity( - e.Properties.First(p => p.Name == "PartitionKey").Value.ToString(), - e.Properties.First(p => p.Name == "RowKey").Value.ToString() - ); + TableEntity entity = new() + { + PartitionKey = e.Properties.First(p => p.Name == "PartitionKey").Value.ToString(), + RowKey = e.Properties.First(p => p.Name == "RowKey").Value.ToString() + }; + var eTag = e.Properties.FirstOrDefault(p => p.Name.Equals("ETag", StringComparison.OrdinalIgnoreCase)); + if (eTag is not null) + { + entity.ETag = new(eTag.Value.ToString()); + } + var timestamp = e.Properties.FirstOrDefault(p => p.Name.Equals("Timestamp", StringComparison.OrdinalIgnoreCase)); + if (timestamp is not null) + { + entity.Timestamp = (DateTimeOffset?)timestamp.Value; + } + return entity; }); - transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.Delete, e))); + transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.Delete, e, validateEtag ? e.ETag : default))); SubmitTransaction(transactions); } @@ -234,9 +255,17 @@ public void AddEntitiesToTable(IEnumerable hashtables, bool overwrite TableEntity entity = new(); foreach (string key in e.Keys) { - if (key != "ETag" && key != "Timestamp") + switch (key) { - entity.Add(key, e[key]); + case "ETag": + entity.ETag = new((string)e[key]); + break; + case "Timestamp": + entity.Timestamp = (DateTimeOffset?)e[key]; + break; + default: + entity.Add(key, e[key]); + break; } } return entity; @@ -270,9 +299,17 @@ public void AddEntitiesToTable(IEnumerable psobjects, bool overwrite = TableEntity entity = new(); foreach (var prop in e.Properties) { - if (prop.Name != "ETag" && prop.Name != "Timestamp") + switch (prop.Name) { - entity.Add(prop.Name, prop.Value); + case "ETag": + entity.ETag = new((string)prop.Value); + break; + case "Timestamp": + entity.Timestamp = (DateTimeOffset?)prop.Value; + break; + default: + entity.Add(prop.Name, prop.Value); + break; } } return entity; @@ -293,8 +330,9 @@ public void AddEntitiesToTable(IEnumerable psobjects, bool overwrite = /// Updates one or more entities in a table. /// /// The entities to update. + /// Whether or not to validate that the ETag is the same and the item has not changed. /// The result of the transaction. - public void UpdateEntitiesInTable(IEnumerable hashtables) + public void UpdateEntitiesInTable(IEnumerable hashtables, bool validateEtag = true) { try { @@ -305,15 +343,23 @@ public void UpdateEntitiesInTable(IEnumerable hashtables) TableEntity entity = new(); foreach (string key in e.Keys) { - if (key != "ETag" && key != "Timestamp") + switch (key) { - entity.Add(key, e[key]); + case "ETag": + entity.ETag = new((string)e[key]); + break; + case "Timestamp": + entity.Timestamp = (DateTimeOffset?)e[key]; + break; + default: + entity.Add(key, e[key]); + break; } } return entity; }); - transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.UpdateMerge, e))); + transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.UpdateMerge, e, validateEtag ? e.ETag : default))); SubmitTransaction(transactions); } @@ -327,8 +373,9 @@ public void UpdateEntitiesInTable(IEnumerable hashtables) /// Updates one or more entities in a table. /// /// The entities to update. + /// Whether or not to validate that the ETag is the same and the item has not changed. /// The result of the transaction. - public void UpdateEntitiesInTable(IEnumerable psobjects) + public void UpdateEntitiesInTable(IEnumerable psobjects, bool validateEtag = true) { try { @@ -339,15 +386,23 @@ public void UpdateEntitiesInTable(IEnumerable psobjects) TableEntity entity = new(); foreach (var prop in e.Properties) { - if (prop.Name != "ETag" && prop.Name != "Timestamp") + switch (prop.Name) { - entity.Add(prop.Name, prop.Value); + case "ETag": + entity.ETag = new((string)prop.Value); + break; + case "Timestamp": + entity.Timestamp = (DateTimeOffset?)prop.Value; + break; + default: + entity.Add(prop.Name, prop.Value); + break; } } return entity; }); - transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.UpdateMerge, e))); + transactions.AddRange(entities.Select(e => new TableTransactionAction(TableTransactionActionType.UpdateMerge, e, validateEtag ? e.ETag : default))); SubmitTransaction(transactions); } diff --git a/source/AzBobbyTables.PS/Cmdlets/RemoveAzDataTableEntity.cs b/source/AzBobbyTables.PS/Cmdlets/RemoveAzDataTableEntity.cs index ff9f353..ba036f0 100644 --- a/source/AzBobbyTables.PS/Cmdlets/RemoveAzDataTableEntity.cs +++ b/source/AzBobbyTables.PS/Cmdlets/RemoveAzDataTableEntity.cs @@ -26,6 +26,12 @@ public class RemoveAzDataTableEntity : AzDataTableOperationCommand [ValidateEntity()] public object[] Entity { get; set; } + /// + /// Skips ETag validation and removes entity even if it has changed. + /// + [Parameter()] + public SwitchParameter Force { get; set; } + /// /// The process step of the pipeline. /// @@ -42,10 +48,10 @@ protected override void ProcessRecord() switch (Entity.First()) { case Hashtable: - tableService.RemoveEntitiesFromTable(Entity.Cast()); + tableService.RemoveEntitiesFromTable(Entity.Cast(), !Force.IsPresent); break; case PSObject: - tableService.RemoveEntitiesFromTable(Entity.Cast()); + tableService.RemoveEntitiesFromTable(Entity.Cast(), !Force.IsPresent); break; default: throw new ArgumentException($"Entities provided were not Hashtable or PSObject! First entity was of type {Entity.GetType().FullName}!"); diff --git a/source/AzBobbyTables.PS/Cmdlets/UpdateAzDataTableEntity.cs b/source/AzBobbyTables.PS/Cmdlets/UpdateAzDataTableEntity.cs index 216e8ef..89aecb9 100644 --- a/source/AzBobbyTables.PS/Cmdlets/UpdateAzDataTableEntity.cs +++ b/source/AzBobbyTables.PS/Cmdlets/UpdateAzDataTableEntity.cs @@ -26,6 +26,12 @@ public class UpdateAzDataTableEntity : AzDataTableOperationCommand [ValidateEntity()] public object[] Entity { get; set; } + /// + /// Skips ETag validation and updates entity even if it has changed. + /// + [Parameter()] + public SwitchParameter Force { get; set; } + /// /// The process step of the pipeline. /// @@ -42,10 +48,10 @@ protected override void ProcessRecord() switch (Entity.First()) { case Hashtable: - tableService.UpdateEntitiesInTable(Entity.Cast()); + tableService.UpdateEntitiesInTable(Entity.Cast(), !Force.IsPresent); break; case PSObject: - tableService.UpdateEntitiesInTable(Entity.Cast()); + tableService.UpdateEntitiesInTable(Entity.Cast(), !Force.IsPresent); break; default: throw new ArgumentException($"Entities provided were not Hashtable or PSObject! First entity was of type {Entity.GetType().FullName}!"); diff --git a/source/AzBobbyTables.PS/Validation/ValidateEntity.cs b/source/AzBobbyTables.PS/Validation/ValidateEntity.cs index 8275710..c5fa77b 100644 --- a/source/AzBobbyTables.PS/Validation/ValidateEntity.cs +++ b/source/AzBobbyTables.PS/Validation/ValidateEntity.cs @@ -34,7 +34,7 @@ protected override void Validate(object arguments, EngineIntrinsics engineIntrin throw new ArgumentException("PartitionKey must be provided in the input psobject entity in the correct casing!"); } if (!psobject.Properties.Any(p => p.Name == "RowKey")) - { + { throw new ArgumentException("RowKey must be provided in the input psobject entity in the correct casing!"); } break; diff --git a/tests/Remove-AzDataTableEntity.Tests.ps1 b/tests/Remove-AzDataTableEntity.Tests.ps1 index 84c896f..2c8151f 100644 --- a/tests/Remove-AzDataTableEntity.Tests.ps1 +++ b/tests/Remove-AzDataTableEntity.Tests.ps1 @@ -18,6 +18,14 @@ BeforeDiscovery { @{ Name = '__AllParameterSets'; Mandatory = $true } ) } + @{ + Command = $Command + Name = 'Force' + Type = 'System.Management.Automation.SwitchParameter' + ParameterSets = @( + @{ Name = '__AllParameterSets'; Mandatory = $false } + ) + } ) } diff --git a/tests/Update-AzDataTableEntity.Tests.ps1 b/tests/Update-AzDataTableEntity.Tests.ps1 index aae0eda..d6c0407 100644 --- a/tests/Update-AzDataTableEntity.Tests.ps1 +++ b/tests/Update-AzDataTableEntity.Tests.ps1 @@ -18,6 +18,14 @@ BeforeDiscovery { @{ Name = '__AllParameterSets'; Mandatory = $true } ) } + @{ + Command = $Command + Name = 'Force' + Type = 'System.Management.Automation.SwitchParameter' + ParameterSets = @( + @{ Name = '__AllParameterSets'; Mandatory = $false } + ) + } ) }