

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](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 Resource Groups 使用者指南》**中的[刪除群組](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 ]

**Tools for 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 參考 (V4)》**中的 [DeleteGroup](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for 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 參考 (V5)》**中的 [DeleteGroup](https://docs.aws.amazon.com/powershell/v5/reference)。

------