

• The Amazon Systems Manager CloudWatch Dashboard will no longer be available after April 30, 2026. Customers can continue to use Amazon CloudWatch console to view, create, and manage their Amazon CloudWatch dashboards, just as they do today. For more information, see [Amazon CloudWatch Dashboard documentation](https://docs.amazonaws.cn/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html). 

# Running commands using a specific document version
<a name="run-command-version"></a>

You can use the document version parameter to specify which version of an Amazon Systems Manager document to use when the command runs. You can specify one of the following options for this parameter:
+ \$1DEFAULT
+ \$1LATEST
+ Version number

Run the following procedure to run a command using the document version parameter. 

------
#### [ Linux ]

**To run commands using the Amazon CLI on local Linux machines**

1. Install and configure the Amazon Command Line Interface (Amazon CLI), if you haven't already.

   For information, see [Installing or updating the latest version of the Amazon CLI](https://docs.amazonaws.cn/cli/latest/userguide/getting-started-install.html).

1. List all available documents

   This command lists all of the documents available for your account based on Amazon Identity and Access Management (IAM) permissions.

   ```
   aws ssm list-documents
   ```

1. Run the following command to view the different versions of a document. Replace *document name* with your own information.

   ```
   aws ssm list-document-versions \
       --name "document name"
   ```

1. Run the following command to run a command that uses an SSM document version. Replace each *example resource placeholder* with your own information.

   ```
   aws ssm send-command \
       --document-name "AWS-RunShellScript" \
       --parameters commands="echo Hello" \
       --instance-ids instance-ID \
       --document-version '$LATEST'
   ```

------
#### [ Windows ]

**To run commands using the Amazon CLI on local Windows machines**

1. Install and configure the Amazon Command Line Interface (Amazon CLI), if you haven't already.

   For information, see [Installing or updating the latest version of the Amazon CLI](https://docs.amazonaws.cn/cli/latest/userguide/getting-started-install.html).

1. List all available documents

   This command lists all of the documents available for your account based on Amazon Identity and Access Management (IAM) permissions.

   ```
   aws ssm list-documents
   ```

1. Run the following command to view the different versions of a document. Replace *document name* with your own information.

   ```
   aws ssm list-document-versions ^
       --name "document name"
   ```

1. Run the following command to run a command that uses an SSM document version. Replace each *example resource placeholder* with your own information.

   ```
   aws ssm send-command ^
       --document-name "AWS-RunShellScript" ^
       --parameters commands="echo Hello" ^
       --instance-ids instance-ID ^
       --document-version "$LATEST"
   ```

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

**To run commands using the Tools for PowerShell**

1. Install and configure the Amazon Tools for PowerShell (Tools for Windows PowerShell), if you haven't already.

   For information, see [Installing the Amazon Tools for PowerShell](https://docs.amazonaws.cn/powershell/latest/userguide/pstools-getting-set-up.html).

1. List all available documents

   This command lists all of the documents available for your account based on Amazon Identity and Access Management (IAM) permissions.

   ```
   Get-SSMDocumentList
   ```

1. Run the following command to view the different versions of a document. Replace *document name* with your own information.

   ```
   Get-SSMDocumentVersionList `
       -Name "document name"
   ```

1. Run the following command to run a command that uses an SSM document version. Replace each *example resource placeholder* with your own information.

   ```
   Send-SSMCommand `
       -DocumentName "AWS-RunShellScript" `
       -Parameter @{commands = "echo helloWorld"} `
       -InstanceIds "instance-ID" `
       -DocumentVersion $LATEST
   ```

------