

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

# 搭配使用 `DeleteRouteTable` 與 CLI
<a name="example_ec2_DeleteRouteTable_section"></a>

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

動作範例是大型程式的程式碼摘錄，必須在內容中執行。您可以在下列程式碼範例的內容中看到此動作：
+  [建立具私有子網路和 NAT 閘道的 VPC](example_vpc_GettingStartedPrivate_section.md) 
+  [開始使用 Amazon VPC](example_vpc_GettingStartedCLI_section.md) 

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

**AWS CLI**  
**刪除路由表**  
此範例會刪除指定的路由表。如果命令成功，則不會傳回任何輸出。  
命令：  

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

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

**Tools for PowerShell V4**  
**範例 1：此範例會刪除指定的路由表。除非也指定 Force 參數，否則在繼續操作之前，系統會提示您確認。**  

```
Remove-EC2RouteTable -RouteTableId rtb-1a2b3c4d
```
**輸出：**  

```
Confirm
Are you sure you want to perform this action?
Performing operation "Remove-EC2RouteTable (DeleteRouteTable)" on Target "rtb-1a2b3c4d".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》**中的 [DeleteRouteTable](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for PowerShell V5**  
**範例 1：此範例會刪除指定的路由表。除非也指定 Force 參數，否則在繼續操作之前，系統會提示您確認。**  

```
Remove-EC2RouteTable -RouteTableId rtb-1a2b3c4d
```
**輸出：**  

```
Confirm
Are you sure you want to perform this action?
Performing operation "Remove-EC2RouteTable (DeleteRouteTable)" on Target "rtb-1a2b3c4d".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》**中的 [DeleteRouteTable](https://docs.aws.amazon.com/powershell/v5/reference)。

------

如需 AWS SDK 開發人員指南和程式碼範例的完整清單，請參閱 [使用 SDK 建立 Amazon EC2 資源 AWS](sdk-general-information-section.md)。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。