

Sono disponibili altri esempi AWS SDK nel repository [AWS Doc SDK](https://github.com/awsdocs/aws-doc-sdk-examples) Examples. GitHub 

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

# WorkSpaces esempi di utilizzo di Tools for V5 PowerShell
<a name="powershell_5_workspaces_code_examples"></a>

I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando AWS Strumenti per PowerShell V5 con. WorkSpaces

Le *azioni* sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le azioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.

Ogni esempio include un link al codice sorgente completo, in cui vengono fornite le istruzioni su come configurare ed eseguire il codice nel contesto.

**Topics**
+ [Azioni](#actions)

## Azioni
<a name="actions"></a>

### `Approve-WKSIpRule`
<a name="workspaces_AuthorizeIpRules_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare`Approve-WKSIpRule`.

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio aggiunge regole a un gruppo di IP esistente**  

```
$Rule = @(
@{IPRule = "10.1.0.0/0"; RuleDesc = "First Rule Added"},
@{IPRule = "10.2.0.0/0"; RuleDesc = "Second Rule Added"}
)

Approve-WKSIpRule -GroupId wsipg-abcnx2fcw -UserRule $Rule
```
+  Per i dettagli sull'API, vedere [AuthorizeIpRules](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Copy-WKSWorkspaceImage`
<a name="workspaces_CopyWorkspaceImage_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Copy-WKSWorkspaceImage`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio copia l'immagine dell'area di lavoro con l'ID specificato da us-west-2 nella regione corrente con il nome "" CopiedImageTest**  

```
Copy-WKSWorkspaceImage -Name CopiedImageTest -SourceRegion us-west-2 -SourceImageId wsi-djfoedhw6
```
**Output:**  

```
wsi-456abaqfe
```
+  Per i dettagli sull'API, vedere [CopyWorkspaceImage](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Edit-WKSClientProperty`
<a name="workspaces_ModifyClientProperties_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Edit-WKSClientProperty`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio abilita la riconnessione per il client Workspaces**  

```
Edit-WKSClientProperty -Region us-west-2 -ClientProperties_ReconnectEnabled "ENABLED" -ResourceId d-123414a369
```
+  Per i dettagli sull'API, vedere [ModifyClientProperties](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Edit-WKSSelfServicePermission`
<a name="workspaces_ModifySelfservicePermissions_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Edit-WKSSelfServicePermission`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio abilita le autorizzazioni self-service per modificare il tipo di calcolo e aumentare le dimensioni del volume per la directory specificata**  

```
Edit-WKSSelfservicePermission -Region us-west-2 -ResourceId d-123454a369 -SelfservicePermissions_ChangeComputeType ENABLED -SelfservicePermissions_IncreaseVolumeSize ENABLED
```
+  Per i dettagli sull'API, vedere [ModifySelfservicePermissions](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Edit-WKSWorkspaceAccessProperty`
<a name="workspaces_ModifyWorkspaceAccessProperties_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Edit-WKSWorkspaceAccessProperty`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio abilita l’accesso allo spazio di lavoro su Android e Chrome OS per la directory specificata**  

```
Edit-WKSWorkspaceAccessProperty -Region us-west-2 -ResourceId d-123454a369 -WorkspaceAccessProperties_DeviceTypeAndroid ALLOW -WorkspaceAccessProperties_DeviceTypeChromeOs ALLOW
```
+  Per i dettagli sull'API, vedere [ModifyWorkspaceAccessProperties](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Edit-WKSWorkspaceCreationProperty`
<a name="workspaces_ModifyWorkspaceCreationProperties_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Edit-WKSWorkspaceCreationProperty`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio abilita le opzioni Accesso a Internet e Modalità di manutenzione su true come valori predefiniti durante la creazione di uno spazio di lavoro**  

```
Edit-WKSWorkspaceCreationProperty -Region us-west-2 -ResourceId d-123454a369 -WorkspaceCreationProperties_EnableInternetAccess $true -WorkspaceCreationProperties_EnableMaintenanceMode $true
```
+  Per i dettagli sull'API, vedere [ModifyWorkspaceCreationProperties](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Edit-WKSWorkspaceProperty`
<a name="workspaces_ModifyWorkspaceProperties_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Edit-WKSWorkspaceProperty`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio imposta la proprietà della modalità di esecuzione dello spazio di lavoro sull’arresto automatico dello spazio di lavoro specificato**  

```
Edit-WKSWorkspaceProperty -WorkspaceId ws-w361s100v -Region us-west-2 -WorkspaceProperties_RunningMode AUTO_STOP
```
+  Per i dettagli sull'API, vedere [ModifyWorkspaceProperties](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Edit-WKSWorkspaceState`
<a name="workspaces_ModifyWorkspaceState_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Edit-WKSWorkspaceState`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio modifica lo stato dello spazio di lavoro specificato in Available**  

```
Edit-WKSWorkspaceState -WorkspaceId ws-w361s100v -Region us-west-2 -WorkspaceState AVAILABLE
```
+  Per i dettagli sull'API, vedere [ModifyWorkspaceState](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSClientProperty`
<a name="workspaces_DescribeClientProperties_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSClientProperty`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio ottiene le proprietà del client Workspace per la directory specificata**  

```
Get-WKSClientProperty -ResourceId d-223562a123
```
+  Per i dettagli sull'API, vedere [DescribeClientProperties](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSIpGroup`
<a name="workspaces_DescribeIpGroups_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSIpGroup`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio ottiene i dettagli del gruppo di IP specificato nella Regione specificata**  

```
Get-WKSIpGroup -Region us-east-1 -GroupId wsipg-8m1234v45
```
**Output:**  

```
GroupDesc GroupId         GroupName UserRules
--------- -------         --------- ---------
          wsipg-8m1234v45 TestGroup {Amazon.WorkSpaces.Model.IpRuleItem, Amazon.WorkSpaces.Model.IpRuleItem}
```
+  Per i dettagli sull'API, vedere [DescribeIpGroups](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSTag`
<a name="workspaces_DescribeTags_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSTag`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio recupera il tag per lo spazio di lavoro specificato**  

```
Get-WKSTag -WorkspaceId ws-w361s234r -Region us-west-2
```
**Output:**  

```
Key         Value
---         -----
auto-delete no
purpose     Workbench
```
+  Per i dettagli sull'API, vedere [DescribeTags](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSWorkspace`
<a name="workspaces_DescribeWorkspaces_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSWorkspace`

**Strumenti per PowerShell V5**  
**Esempio 1: recupera i dettagli di tutti gli accessi WorkSpaces alla pipeline.**  

```
Get-WKSWorkspace
```
**Output:**  

```
BundleId                    : wsb-1a2b3c4d
ComputerName                :
DirectoryId                 : d-1a2b3c4d
ErrorCode                   :
ErrorMessage                :
IpAddress                   :
RootVolumeEncryptionEnabled : False
State                       : PENDING
SubnetId                    :
UserName                    : myuser
UserVolumeEncryptionEnabled : False
VolumeEncryptionKey         :
WorkspaceId                 : ws-1a2b3c4d
WorkspaceProperties         : Amazon.WorkSpaces.Model.WorkspaceProperties
```
**Esempio 2: questo comando mostra i valori delle proprietà secondarie di `WorkSpaceProperties` per uno spazio di lavoro nella Regione `us-west-2`. Per ulteriori informazioni sulle proprietà secondarie di`WorkSpaceProperties`, vedere https://docs.aws.amazon.com/workspaces/ latest/api/API \$1 WorkspaceProperties .html.**  

```
(Get-WKSWorkspace -Region us-west-2 -WorkSpaceId ws-xdaf7hc9s).WorkspaceProperties
```
**Output:**  

```
        ComputeTypeName                     : STANDARD
        RootVolumeSizeGib                   : 80
        RunningMode                         : AUTO_STOP
        RunningModeAutoStopTimeoutInMinutes : 60
        UserVolumeSizeGib                   : 50
```
**Esempio 3: questo comando mostra i valori delle proprietà secondarie `RootVolumeSizeGib` di `WorkSpaceProperties` per uno spazio di lavoro nella Regione `us-west-2`. La dimensione del volume root, in GiB, è 80.**  

```
(Get-WKSWorkspace -Region us-west-2 -WorkSpaceId ws-xdaf7hc9s).WorkspaceProperties.RootVolumeSizeGib
```
**Output:**  

```
        80
```
+  Per i dettagli sull'API, vedere [DescribeWorkspaces](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSWorkspaceBundle`
<a name="workspaces_DescribeWorkspaceBundles_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSWorkspaceBundle`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio recupera i dettagli di tutti i bundle dello spazio di lavoro nella Regione corrente**  

```
Get-WKSWorkspaceBundle
```
**Output:**  

```
BundleId        : wsb-sfhdgv342
ComputeType     : Amazon.WorkSpaces.Model.ComputeType
Description     : This bundle is custom
ImageId         : wsi-235aeqges
LastUpdatedTime : 12/26/2019 06:44:07
Name            : CustomBundleTest
Owner           : 233816212345
RootStorage     : Amazon.WorkSpaces.Model.RootStorage
UserStorage     : Amazon.WorkSpaces.Model.UserStorage
```
+  Per i dettagli sull'API, vedere [DescribeWorkspaceBundles](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSWorkspaceDirectory`
<a name="workspaces_DescribeWorkspaceDirectories_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSWorkspaceDirectory`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio elenca i dettagli delle directory registrate**  

```
Get-WKSWorkspaceDirectory
```
**Output:**  

```
Alias                       : TestWorkspace
CustomerUserName            : Administrator
DirectoryId                 : d-123414a369
DirectoryName               : TestDirectory.com
DirectoryType               : MicrosoftAD
DnsIpAddresses              : {172.31.43.45, 172.31.2.97}
IamRoleId                   : arn:aws:iam::761234567801:role/workspaces_RoleDefault
IpGroupIds                  : {}
RegistrationCode            : WSpdx+4RRT43
SelfservicePermissions      : Amazon.WorkSpaces.Model.SelfservicePermissions
State                       : REGISTERED
SubnetIds                   : {subnet-1m3m7b43, subnet-ard11aba}
Tenancy                     : SHARED
WorkspaceAccessProperties   : Amazon.WorkSpaces.Model.WorkspaceAccessProperties
WorkspaceCreationProperties : Amazon.WorkSpaces.Model.DefaultWorkspaceCreationProperties
WorkspaceSecurityGroupId    : sg-0ed2441234a123c43
```
+  Per i dettagli sull'API, vedere [DescribeWorkspaceDirectories](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSWorkspaceImage`
<a name="workspaces_DescribeWorkspaceImages_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSWorkspaceImage`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio recupera tutti i dettagli di tutte le immagini nella Regione**  

```
Get-WKSWorkspaceImage
```
**Output:**  

```
Description     :This image is copied from another image
ErrorCode       :
ErrorMessage    :
ImageId         : wsi-345ahdjgo
Name            : CopiedImageTest
OperatingSystem : Amazon.WorkSpaces.Model.OperatingSystem
RequiredTenancy : DEFAULT
State           : AVAILABLE
```
+  Per i dettagli sull'API, vedere [DescribeWorkspaceImages](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSWorkspaceSnapshot`
<a name="workspaces_DescribeWorkspaceSnapshots_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSWorkspaceSnapshot`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio mostra il timestamp dello snapshot più recente creato per lo spazio di lavoro specificato**  

```
Get-WKSWorkspaceSnapshot -WorkspaceId ws-w361s100v
```
**Output:**  

```
RebuildSnapshots                   RestoreSnapshots
----------------                   ----------------
{Amazon.WorkSpaces.Model.Snapshot} {Amazon.WorkSpaces.Model.Snapshot}
```
+  Per i dettagli sull'API, vedere [DescribeWorkspaceSnapshots](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-WKSWorkspacesConnectionStatus`
<a name="workspaces_DescribeWorkspacesConnectionStatus_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Get-WKSWorkspacesConnectionStatus`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio recupera lo stato della connessione per lo spazio di lavoro specificato**  

```
Get-WKSWorkspacesConnectionStatus -WorkspaceId ws-w123s234r
```
+  Per i dettagli sull'API, vedere [DescribeWorkspacesConnectionStatus](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `New-WKSIpGroup`
<a name="workspaces_CreateIpGroup_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `New-WKSIpGroup`

**Strumenti per PowerShell V5**  
**Esempio 1: Questo esempio crea un gruppo Ip vuoto denominato FreshEmptyIpGroup**  

```
New-WKSIpGroup -GroupName "FreshNewIPGroup"
```
**Output:**  

```
wsipg-w45rty4ty
```
+  Per i dettagli sull'API, vedere [CreateIpGroup](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `New-WKSTag`
<a name="workspaces_CreateTags_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `New-WKSTag`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio aggiunge un nuovo tag a uno spazio di lavoro denominato `ws-wsname`. Il tag include la chiave “Name” e il valore chiave `AWS_Workspace`.**  

```
$tag = New-Object Amazon.WorkSpaces.Model.Tag
$tag.Key = "Name"
$tag.Value = "AWS_Workspace"
New-WKSTag -Region us-west-2 -WorkspaceId ws-wsname -Tag $tag
```
**Esempio 2: questo esempio aggiunge più tag a uno spazio di lavoro denominato `ws-wsname`. Un tag include la chiave “Name” e il valore di chiave `AWS_Workspace`, mentre l’altro tag include una chiave “Stage” e il valore di chiave “Test”.**  

```
$tag = New-Object Amazon.WorkSpaces.Model.Tag
$tag.Key = "Name"
$tag.Value = "AWS_Workspace"

$tag2 = New-Object Amazon.WorkSpaces.Model.Tag
$tag2.Key = "Stage"
$tag2.Value = "Test"
New-WKSTag -Region us-west-2 -WorkspaceId ws-wsname -Tag $tag,$tag2
```
+  Per i dettagli sull'API, vedere [CreateTags](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `New-WKSWorkspace`
<a name="workspaces_CreateWorkspaces_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `New-WKSWorkspace`

**Strumenti per PowerShell V5**  
**Esempio 1: crea un file WorkSpace per il pacchetto, la directory e l'utente forniti.**  

```
New-WKSWorkspace -Workspace @{"BundleID" = "wsb-1a2b3c4d"; "DirectoryId" = "d-1a2b3c4d"; "UserName" = "USERNAME"}
```
**Esempio 2: Questo esempio crea più WorkSpaces**  

```
New-WKSWorkspace -Workspace @{"BundleID" = "wsb-1a2b3c4d"; "DirectoryId" = "d-1a2b3c4d"; "UserName" = "USERNAME_1"},@{"BundleID" = "wsb-1a2b3c4d"; "DirectoryId" = "d-1a2b3c4d"; "UserName" = "USERNAME_2"}
```
+  Per i dettagli sull'API, vedere [CreateWorkspaces](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Register-WKSIpGroup`
<a name="workspaces_AssociateIpGroups_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Register-WKSIpGroup`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio registra il gruppo di IP specificato con la directory specificata**  

```
Register-WKSIpGroup -GroupId wsipg-23ahsdres -DirectoryId d-123412e123
```
+  Per i dettagli sull'API, vedere [AssociateIpGroups](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Register-WKSWorkspaceDirectory`
<a name="workspaces_RegisterWorkspaceDirectory_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Register-WKSWorkspaceDirectory`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio registra la directory specificata per il servizio Workspaces**  

```
Register-WKSWorkspaceDirectory -DirectoryId d-123412a123 -EnableWorkDoc $false
```
+  Per i dettagli sull'API, vedere [RegisterWorkspaceDirectory](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Remove-WKSIpGroup`
<a name="workspaces_DeleteIpGroup_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Remove-WKSIpGroup`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio elimina il gruppo di IP specificato**  

```
Remove-WKSIpGroup -GroupId wsipg-32fhgtred
```
**Output:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-WKSIpGroup (DeleteIpGroup)" on target "wsipg-32fhgtred".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  Per i dettagli sull'API, vedere [DeleteIpGroup](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Remove-WKSTag`
<a name="workspaces_DeleteTags_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Remove-WKSTag`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio rimuove il tag associato allo spazio di lavoro**  

```
Remove-WKSTag -ResourceId ws-w10b3abcd -TagKey "Type"
```
**Output:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-WKSTag (DeleteTags)" on target "ws-w10b3abcd".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  Per i dettagli sull'API, vedere [DeleteTags](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Remove-WKSWorkspace`
<a name="workspaces_TerminateWorkspaces_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Remove-WKSWorkspace`

**Strumenti per PowerShell V5**  
**Esempio 1: termina più elementi WorkSpaces. L'uso dello switch -Force impedisce al cmdlet di richiedere la conferma.**  

```
Remove-WKSWorkspace -WorkspaceId "ws-1a2b3c4d5","ws-6a7b8c9d0" -Force
```
**Esempio 2: recupera la raccolta di tutti i file WorkSpaces e reindirizza il WorkSpaceId parametro - IDs di Remove-WKSWorkspace, terminando tutti i file. WorkSpaces Il cmdlet verrà visualizzato prima che ciascuna di esse venga terminata. WorkSpace Per disattivare la richiesta di conferma, aggiungi il parametro -Force.**  

```
Get-WKSWorkspaces | Remove-WKSWorkspace
```
**Esempio 3: questo esempio mostra come passare TerminateRequest oggetti che definiscono l' WorkSpaces oggetto da terminare. Il cmdlet richiederà una conferma prima di procedere, a meno che non venga specificato anche il parametro switch -Force.**  

```
$arrRequest = @()
$request1 = New-Object Amazon.WorkSpaces.Model.TerminateRequest
$request1.WorkspaceId = 'ws-12345678'
$arrRequest += $request1
$request2 = New-Object Amazon.WorkSpaces.Model.TerminateRequest
$request2.WorkspaceId = 'ws-abcdefgh'
$arrRequest += $request2
Remove-WKSWorkspace -Request $arrRequest
```
+  Per i dettagli sull'API, vedere [TerminateWorkspaces](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Reset-WKSWorkspace`
<a name="workspaces_RebuildWorkspaces_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Reset-WKSWorkspace`

**Strumenti per PowerShell V5**  
**Esempio 1: ricostruisce quanto specificato. WorkSpace**  

```
Reset-WKSWorkspace -WorkspaceId "ws-1a2b3c4d"
```
**Esempio 2: recupera la raccolta di tutti i dati WorkSpaces e invia il WorkSpaceId parametro - di Reset- IDs al parametro -WKSWorkspace, provocandone la ricostruzione WorkSpaces .**  

```
Get-WKSWorkspaces | Reset-WKSWorkspace
```
+  Per i dettagli sull'API, vedere [RebuildWorkspaces](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference* (V5). 

### `Restart-WKSWorkspace`
<a name="workspaces_RebootWorkspaces_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Restart-WKSWorkspace`

**Strumenti per PowerShell V5**  
**Esempio 1: riavvia il file specificato. WorkSpace**  

```
Restart-WKSWorkspace -WorkspaceId "ws-1a2b3c4d"
```
**Esempio 2: riavvia più volte. WorkSpaces**  

```
Restart-WKSWorkspace -WorkspaceId "ws-1a2b3c4d","ws-5a6b7c8d"
```
**Esempio 3: recupera la raccolta di tutti i WorkSpaces file e invia il IDs WorkSpaceId parametro - di Restart-WKSWorkspace, provocandone il WorkSpaces riavvio.**  

```
Get-WKSWorkspaces | Restart-WKSWorkspace
```
+  Per i dettagli sull'API, vedere [RebootWorkspaces](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Stop-WKSWorkspace`
<a name="workspaces_StopWorkspaces_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Stop-WKSWorkspace`

**Strumenti per PowerShell V5**  
**Esempio 1: arresta più volte WorkSpaces.**  

```
Stop-WKSWorkspace -WorkspaceId "ws-1a2b3c4d5","ws-6a7b8c9d0"
```
**Esempio 2: recupera l'insieme di tutti i file WorkSpaces e invia il IDs WorkSpaceId parametro - di Stop- WorkSpaces al parametro - WKSWorkspace che causa l'interruzione.**  

```
Get-WKSWorkspaces | Stop-WKSWorkspace
```
**Esempio 3: Questo esempio mostra come passare StopRequest oggetti che definiscono il punto WorkSpaces da fermare.**  

```
$arrRequest = @()
$request1 = New-Object Amazon.WorkSpaces.Model.StopRequest
$request1.WorkspaceId = 'ws-12345678'
$arrRequest += $request1
$request2 = New-Object Amazon.WorkSpaces.Model.StopRequest
$request2.WorkspaceId = 'ws-abcdefgh'
$arrRequest += $request2
Stop-WKSWorkspace -Request $arrRequest
```
+  Per i dettagli sull'API, vedere [StopWorkspaces](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Unregister-WKSIpGroup`
<a name="workspaces_DisassociateIpGroups_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Unregister-WKSIpGroup`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio annulla la registrazione del gruppo di IP specificato con la directory specificata**  

```
Unregister-WKSIpGroup -GroupId wsipg-12abcdphq -DirectoryId d-123454b123
```
+  Per i dettagli sull'API, vedere [DisassociateIpGroups](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 