

• AWS Systems Manager CloudWatch ダッシュボードは、2026 年 4 月 30 日以降は利用できなくなります。お客様は、これまでと同様に Amazon CloudWatch コンソールを使用して、Amazon CloudWatch ダッシュボードの表示、作成、管理を継続できます。詳細については、「[Amazon CloudWatch ダッシュボードのドキュメント](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)」を参照してください。

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

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

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

**AWS CLI**  
**ドキュメントバージョンを一覧表示するには**  
次の `list-document-versions` の例では、Systems Manager ドキュメントのすべてのバージョンを一覧表示します。  

```
aws ssm list-document-versions \
    --name "Example"
```
出力:  

```
{
    "DocumentVersions": [
        {
            "Name": "Example",
            "DocumentVersion": "1",
            "CreatedDate": 1583257938.266,
            "IsDefaultVersion": true,
            "DocumentFormat": "YAML",
            "Status": "Active"
        }
    ]
}
```
詳細については、「*AWS Systems Manager ユーザーガイド*」の「[ドキュメントバージョンパラメータを使用するコマンドの実行](https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command-version.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*.」の「[ListDocumentVersions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/list-document-versions.html)」を参照してください。

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

**Tools for PowerShell V4**  
**例 1: この例では、ドキュメントのすべてのバージョンを一覧表示します。**  

```
Get-SSMDocumentVersionList -Name "AWS-UpdateSSMAgent"
```
**出力:**  

```
CreatedDate       : 6/1/2021 5:19:10 PM
DocumentFormat    : JSON
DocumentVersion   : 1
IsDefaultVersion  : True
Name              : AWS-UpdateSSMAgent
Status            : Active
```
+  API の詳細については、*AWS Tools for PowerShell コマンドレットリファレンス (V4)* の「[ListDocumentVersions](https://docs.aws.amazon.com/powershell/v4/reference)」を参照してください。

**Tools for PowerShell V5**  
**例 1: この例では、ドキュメントのすべてのバージョンを一覧表示します。**  

```
Get-SSMDocumentVersionList -Name "AWS-UpdateSSMAgent"
```
**出力:**  

```
CreatedDate       : 6/1/2021 5:19:10 PM
DocumentFormat    : JSON
DocumentVersion   : 1
IsDefaultVersion  : True
Name              : AWS-UpdateSSMAgent
Status            : Active
```
+  API の詳細については、AWS Tools for PowerShell Cmdlet リファレンス (V5) の「[ListDocumentVersions](https://docs.aws.amazon.com/powershell/v5/reference)」を参照してください。

------

AWS SDK デベロッパーガイドとコード例の詳細なリストについては、[このサービスを AWS SDK で使用する](sdk-general-information-section.md) を参照してください。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。