你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Remove-AzEventHubConsumerGroup

删除指定的事件中心使用者组。

语法

Remove-AzEventHubConsumerGroup
      [-ResourceGroupName] <String>
      [-Namespace] <String>
      [-EventHub] <String>
      [-Name] <String>
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzEventHubConsumerGroup
      [-InputObject] <PSConsumerGroupAttributes>
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzEventHubConsumerGroup
      [-ResourceId] <String>
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

说明

Remove-AzEventHubConsumerGroup cmdlet 从给定的事件中心中删除和删除指定的使用者组。

示例

示例 1

PS C:\> Remove-AzEventHubConsumerGroup -ResourceGroupName MyResourceGroupName -Namespace MyNamespaceName -EventHub MyEventHubName -Name MyConsumerGroupName

从事件中心“MyEventHubName”中删除使用者组“MyConsumerGroupName”,范围限定为“MyNamespaceName” 命名空间。

示例 2.1 - InputObject - 使用变量

PS C:\> $inputobject = Get-AzEventHubConsumerGroup <params>
PS C:\> Remove-AzEventHubConsumerGroup -InputObject $inputobject

示例 2.2 - InputObject - 使用管道

PS C:\> Get-AzEventHubConsumerGroup <params> | Remove-AzEventHubConsumerGroup

示例 3.1 - 使用变量的 ResourceId

PS C:\> $resourceid = Get-AzEventHubConsumerGroup <params>
PS C:\> Remove-AzEventHubConsumerGroup -ResourceId $resourceid.Id

示例 3.2 - 使用字符串的 ResourceId

PS C:\> Remove-AzEventHubConsumerGroup -ResourceId "/subscriptions/xxx-xxxx-xxxxx-xxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.EventHub/namespaces/NamespaceName/eventhubs/EventHubName/consumergroups/ConsumerGroupName"

参数

-AsJob

在后台运行 cmdlet

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Confirm

提示你在运行 cmdlet 之前进行确认。

类型:SwitchParameter
别名:cf
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

类型:IAzureContextContainer
别名:AzContext, AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-EventHub

EventHub 名称

类型:String
别名:EventHubName
Position:2
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-InputObject

ConsumerGroup 对象

类型:PSConsumerGroupAttributes
Position:0
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-Name

ConsumerGroup 名称

类型:String
别名:ConsumerGroupName
Position:3
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-Namespace

命名空间名称

类型:String
别名:NamespaceName
Position:1
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-PassThru

如果命令成功,则指定此项将返回 true。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-ResourceGroupName

资源组名称

类型:String
Position:0
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-ResourceId

ConsumerGroup 资源 ID

类型:String
Position:0
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-WhatIf

显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。

类型:SwitchParameter
别名:wi
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输入

String

PSConsumerGroupAttributes

输出

Void