Public/Remove-AzTableAPITable.ps1
|
function Remove-AzTableAPITable { <# .SYNOPSIS Deletes a table from Azure Table Storage. .PARAMETER Context Connection context created by New-AzTableAPIContext. .PARAMETER TableName Name of the table to delete. .EXAMPLE Remove-AzTableAPITable -Context $ctx -TableName 'Orders' .EXAMPLE Remove-AzTableAPITable -Context $ctx -TableName 'Orders' -WhatIf #> [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] param ( [Parameter(Mandatory)] [ValidateScript({ ($_.PSObject.Properties.Name -contains 'Endpoint') -and ($_.PSObject.Properties.Name -contains 'AuthType') }, ErrorMessage = 'The -Context parameter requires a context object created by New-AzTableAPIContext.')] [PSCustomObject]$Context, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$TableName ) if ($PSCmdlet.ShouldProcess($TableName, 'Remove Azure Table Storage table')) { $resource = "Tables('$TableName')" Invoke-AzTableRestMethod -Context $Context -Method 'DELETE' -Resource $resource | Out-Null } } |