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

Remove-AzureRmEventHubConsumerGroup

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

警告

截至 2024 年 2 月 29 日,AzureRM PowerShell 模块已正式弃用。 为了确保持续获得支持和更新,建议用户从 AzureRM 迁移到 Az PowerShell 模块。

尽管 AzureRM 模块仍可能正常运行,但它不再维护或受支持,但会根据用户的自由裁量权和风险继续使用任何继续使用模块。 有关过渡到 Az 模块的指导,请参阅我们的迁移资源

语法

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

说明

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

示例

示例 1

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

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

示例 2.1 - InputObject - 使用变量

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

示例 2.2 - InputObject - 使用管道

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

示例 3.1 - 使用 Vairable 的 ResourceId

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

示例 3.2 - 使用字符串的 ResourceId

PS C:\> Remove-AzureRmEventHubConsumerGroup -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
别名: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

参数:InputObject (ByValue)

输出

Void