Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.Use ListDocumentVersions with a CLI
The following code examples show how to use ListDocumentVersions.
- CLI
-
- AWS CLI
-
To list document versions
The following list-document-versions example lists all versions for a Systems Manager document.
aws ssm list-document-versions \
--name "Example"
Output:
{
"DocumentVersions": [
{
"Name": "Example",
"DocumentVersion": "1",
"CreatedDate": 1583257938.266,
"IsDefaultVersion": true,
"DocumentFormat": "YAML",
"Status": "Active"
}
]
}
For more information, see Sending Commands that Use the Document Version Parameter in the AWS Systems Manager User Guide.
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example lists all the versions for a document.
Get-SSMDocumentVersionList -Name "AWS-UpdateSSMAgent"
Output:
CreatedDate : 6/1/2021 5:19:10 PM
DocumentFormat : JSON
DocumentVersion : 1
IsDefaultVersion : True
Name : AWS-UpdateSSMAgent
Status : Active
- Tools for PowerShell V5
-
Example 1: This example lists all the versions for a document.
Get-SSMDocumentVersionList -Name "AWS-UpdateSSMAgent"
Output:
CreatedDate : 6/1/2021 5:19:10 PM
DocumentFormat : JSON
DocumentVersion : 1
IsDefaultVersion : True
Name : AWS-UpdateSSMAgent
Status : Active
For a complete list of AWS SDK developer guides and code examples, see
Using this service with an AWS SDK.
This topic also includes information about getting started and details about previous SDK versions.