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 33e1afe..b5a37c2 100644 --- a/docs/help/Remove-AzDataTableEntity.md +++ b/docs/help/Remove-AzDataTableEntity.md @@ -54,6 +54,20 @@ 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 diff --git a/docs/help/Update-AzDataTableEntity.md b/docs/help/Update-AzDataTableEntity.md index 7e7c0ef..b005e28 100644 --- a/docs/help/Update-AzDataTableEntity.md +++ b/docs/help/Update-AzDataTableEntity.md @@ -31,13 +31,28 @@ The PartitionKey and RowKey cannot be updated. ### Example 1 ```powershell -PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby'" -TableName $TableName -ConnectionString $ConnectionString +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 -TableName $TableName -ConnectionString $ConnectionString +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