Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use ListDocumentVersions
with a CLI
The following code examples show how to use ListDocumentVersions
.
- CLI
-
- Amazon 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 Amazon 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
For a complete list of Amazon SDK developer guides and code examples, see
Using this service with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.