

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 `RebootWorkspaces` dengan CLI
<a name="workspaces_example_workspaces_RebootWorkspaces_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`RebootWorkspaces`.

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

**AWS CLI**  
**Untuk me-reboot a WorkSpace**  
`reboot-workspaces`Contoh berikut reboot yang ditentukan WorkSpace.  

```
aws workspaces reboot-workspaces \
    --reboot-workspace-requests ws-dk1xzr417
```
Output:  

```
{
    "FailedRequests": []
}
```
Untuk informasi selengkapnya, lihat [Reboot a WorkSpace](https://docs.aws.amazon.com/workspaces/latest/adminguide/reboot-workspaces.html) di *Panduan WorkSpaces Administrasi Amazon*.  
+  Untuk detail API, lihat [RebootWorkspaces](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/workspaces/reboot-workspaces.html)di *Referensi AWS CLI Perintah*. 

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

**Alat untuk PowerShell V4**  
**Contoh 1: Reboot yang ditentukan WorkSpace.**  

```
Restart-WKSWorkspace -WorkspaceId "ws-1a2b3c4d"
```
**Contoh 2: Reboot beberapa WorkSpaces.**  

```
Restart-WKSWorkspace -WorkspaceId "ws-1a2b3c4d","ws-5a6b7c8d"
```
**Contoh 3: Mengambil koleksi semua Anda WorkSpaces dan pipa IDs ke - WorkSpaceId parameter Restart-WKSWorkspace, menyebabkan restart. WorkSpaces **  

```
Get-WKSWorkspaces | Restart-WKSWorkspace
```
+  Untuk detail API, lihat [RebootWorkspaces](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Reboot yang ditentukan WorkSpace.**  

```
Restart-WKSWorkspace -WorkspaceId "ws-1a2b3c4d"
```
**Contoh 2: Reboot beberapa WorkSpaces.**  

```
Restart-WKSWorkspace -WorkspaceId "ws-1a2b3c4d","ws-5a6b7c8d"
```
**Contoh 3: Mengambil koleksi semua Anda WorkSpaces dan pipa IDs ke - WorkSpaceId parameter Restart-WKSWorkspace, menyebabkan restart. WorkSpaces **  

```
Get-WKSWorkspaces | Restart-WKSWorkspace
```
+  Untuk detail API, lihat [RebootWorkspaces](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------