

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 搭配使用 `DeleteHostedZone` 與 CLI
<a name="route-53_example_route-53_DeleteHostedZone_section"></a>

下列程式碼範例示範如何使用 `DeleteHostedZone`。

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

**AWS CLI**  
**刪除託管區域**  
下列 `delete-hosted-zone` 命令會使用 `Z36KTIQEXAMPLE` 的 `id` 刪除託管區域：  

```
aws route53 delete-hosted-zone --id Z36KTIQEXAMPLE
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteHostedZone](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53/delete-hosted-zone.html)。

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

**Tools for PowerShell V4**  
**範例 1：刪除具有指定 ID 的託管區域。除非您新增 -Force 切換變數，否則會在命令繼續之前，提示您進行確認。**  

```
Remove-R53HostedZone -Id Z1PA6795UKMFR9
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》**中的 [DeleteHostedZone](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for PowerShell V5**  
**範例 1：刪除具有指定 ID 的託管區域。除非您新增 -Force 切換變數，否則會在命令繼續之前，提示您進行確認。**  

```
Remove-R53HostedZone -Id Z1PA6795UKMFR9
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》**中的 [DeleteHostedZone](https://docs.aws.amazon.com/powershell/v5/reference)。

------