

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 搭配使用 `StopAutomationExecution` 與 CLI
<a name="ssm_example_ssm_StopAutomationExecution_section"></a>

下列程式碼範例示範如何使用 `StopAutomationExecution`。

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

**AWS CLI**  
**停止自動化執行**  
下列 `stop-automation-execution` 範例示範停止執行 Automation 文件。  

```
aws ssm stop-automation-execution
    --automation-execution-id "4105a4fc-f944-11e6-9d32-0a1b2EXAMPLE"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱《AWS Systems Manager 使用者指南》**中的 [Running an Automation Workflow Manually](https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-working-executing-manually.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [StopAutomationExecution](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/stop-automation-execution.html)。

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

**Tools for PowerShell V4**  
**範例 1：此範例示範停止自動化執行。如果命令成功，則無輸出訊息。**  

```
Stop-SSMAutomationExecution -AutomationExecutionId "4105a4fc-f944-11e6-9d32-8fb2db27a909"
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》**中的 [StopAutomationExecution](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for PowerShell V5**  
**範例 1：此範例示範停止自動化執行。如果命令成功，則無輸出訊息。**  

```
Stop-SSMAutomationExecution -AutomationExecutionId "4105a4fc-f944-11e6-9d32-8fb2db27a909"
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》**中的 [StopAutomationExecution](https://docs.aws.amazon.com/powershell/v5/reference)。

------