

文档 AWS SDK 示例 GitHub 存储库中还有更多 [S AWS DK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 将 `DeleteGroup` 与 CLI 配合使用
<a name="resource-groups_example_resource-groups_DeleteGroup_section"></a>

以下代码示例演示如何使用 `DeleteGroup`。

------
#### [ CLI ]

**AWS CLI**  
**更新资源组的描述**  
以下 `delete-group` 示例更新了指定资源组。  

```
aws resource-groups delete-group \
    --group-name tbq-WebServer
```
输出：  

```
{
    "Group": {
        "GroupArn": "arn:aws:resource-groups:us-west-2:1234567890:group/tbq-WebServer",
        "Name": "tbq-WebServer"
    }
}
```
有关更多信息，请参阅《AWS 用户指南》**中的[删除组](https://docs.aws.amazon.com/ARG/latest/userguide/deleting-resource-groups.html)。  
+  有关 API 的详细信息，请参阅*AWS CLI 命令参考[DeleteGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/resource-groups/delete-group.html)*中的。

------
#### [ PowerShell ]

**适用于 PowerShell V4 的工具**  
**示例 1：此示例移除指定的资源组**  

```
Remove-RGGroup -GroupName non-tag-cfn-elbv2
```
**输出**：  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-RGGroup (DeleteGroup)" on target "non-tag-cfn-elbv2".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y

Description GroupArn                                                               Name
----------- --------                                                               ----
            arn:aws:resource-groups:eu-west-1:123456789012:group/non-tag-cfn-elbv2 non-tag-cfn-elbv2
```
+  有关 API 的详细信息，请参阅 *AWS Tools for PowerShell Cmdlet 参考 (V* 4) [DeleteGroup](https://docs.aws.amazon.com/powershell/v4/reference)中的。

**适用于 PowerShell V5 的工具**  
**示例 1：此示例移除指定的资源组**  

```
Remove-RGGroup -GroupName non-tag-cfn-elbv2
```
**输出**：  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-RGGroup (DeleteGroup)" on target "non-tag-cfn-elbv2".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y

Description GroupArn                                                               Name
----------- --------                                                               ----
            arn:aws:resource-groups:eu-west-1:123456789012:group/non-tag-cfn-elbv2 non-tag-cfn-elbv2
```
+  有关 API 的详细信息，请参阅 *AWS Tools for PowerShell Cmdlet 参考 (V* 5) [DeleteGroup](https://docs.aws.amazon.com/powershell/v5/reference)中的。

------