

Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh [SDK AWS Doc](https://github.com/awsdocs/aws-doc-sdk-examples). GitHub 

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Gunakan `CancelCommand` dengan CLI
<a name="ssm_example_ssm_CancelCommand_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`CancelCommand`.

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

**AWS CLI**  
**Contoh 1: Untuk membatalkan perintah untuk semua instance**  
`cancel-command`Contoh berikut mencoba untuk membatalkan perintah tertentu yang sudah berjalan untuk semua instance.  

```
aws ssm cancel-command \
    --command-id "662add3d-5831-4a10-b64a-f2ff3EXAMPLE"
```
Perintah ini tidak menghasilkan output.  
**Contoh 2: Untuk membatalkan perintah untuk instance tertentu**  
`cancel-command`Contoh berikut mencoba untuk membatalkan perintah untuk instance tertentu saja.  

```
aws ssm cancel-command \
    --command-id "662add3d-5831-4a10-b64a-f2ff3EXAMPLE"
    --instance-ids "i-02573cafcfEXAMPLE"
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Menandai Parameter Systems Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-su-tag.html) di *Panduan Pengguna AWS Systems Manager*.  
+  Untuk detail API, lihat [CancelCommand](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/cancel-command.html)di *Referensi AWS CLI Perintah*. 

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

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mencoba untuk membatalkan perintah. Tidak ada output jika operasi berhasil.**  

```
Stop-SSMCommand -CommandId "9ded293e-e792-4440-8e3e-7b8ec5feaa38"
```
+  Untuk detail API, lihat [CancelCommand](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mencoba untuk membatalkan perintah. Tidak ada output jika operasi berhasil.**  

```
Stop-SSMCommand -CommandId "9ded293e-e792-4440-8e3e-7b8ec5feaa38"
```
+  Untuk detail API, lihat [CancelCommand](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------