

Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 [AWS](https://github.com/awsdocs/aws-doc-sdk-examples)

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# CLI で `DeleteTags` を使用する
<a name="workspaces_example_workspaces_DeleteTags_section"></a>

次のサンプルコードは、`DeleteTags` を使用する方法を説明しています。

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

**AWS CLI**  
**WorkSpace からタグを削除するには**  
次の `delete-tags` の例では、指定された WorkSpace から指定されたタグを削除します。  

```
aws workspaces delete-tags \
    --resource-id {{ws-dk1xzr417}} \
    --tag-keys {{Department}}
```
このコマンドでは何も出力されません。  
詳細については、「*Amazon WorkSpaces 管理ガイド*」の「[WorkSpaces リソースのタグ付け](https://docs.aws.amazon.com/workspaces/latest/adminguide/tag-workspaces-resources.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteTags](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/workspaces/delete-tags.html)」を参照してください。

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

**Tools for PowerShell V4**  
**例 1: このサンプルは、Workspace に関連付けられたタグを削除します。**  

```
Remove-WKSTag -ResourceId ws-w10b3abcd -TagKey "Type"
```
**出力:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-WKSTag (DeleteTags)" on target "ws-w10b3abcd".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API の詳細については、「*AWS Tools for PowerShell コマンドレットリファレンス (V4)*」の「[DeleteTags](https://docs.aws.amazon.com/powershell/v4/reference)」を参照してください。

**Tools for PowerShell V5**  
**例 1: このサンプルは、Workspace に関連付けられたタグを削除します。**  

```
Remove-WKSTag -ResourceId ws-w10b3abcd -TagKey "Type"
```
**出力:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-WKSTag (DeleteTags)" on target "ws-w10b3abcd".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API の詳細については、「*AWS Tools for PowerShell コマンドレットリファレンス (V5)*」の「[DeleteTags](https://docs.aws.amazon.com/powershell/v5/reference)」を参照してください。

------