Functions/Public/Remove-InfluxDbMeasurement.ps1
function Remove-InfluxDbMeasurement { [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Database , [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Measurement ) begin { if (-not $PSBoundParameters.ContainsKey('Confirm')) { $ConfirmPreference = $PSCmdlet.SessionState.PSVariable.GetValue('ConfirmPreference') } if (-not $PSBoundParameters.ContainsKey('WhatIf')) { $WhatIfPreference = $PSCmdlet.SessionState.PSVariable.GetValue('WhatIfPreference') } } process { if ($Force -or $PSCmdlet.ShouldProcess("Remove database '$Database'?")) { Invoke-InfluxDbApi -Database $Database -Query "DROP MEASUREMENT $Measurement" -Method Post } } } |