

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 applicazioni che utilizzano Tools for V5 PowerShell
<a name="powershell_5_appstream_code_examples"></a>

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

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>

### `Add-APSResourceTag`
<a name="appstream_TagResource_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare`Add-APSResourceTag`.

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio aggiunge un tag di risorsa alla AppStream risorsa**  

```
Add-APSResourceTag -ResourceArn arn:aws:appstream:us-east-1:123456789012:stack/SessionScriptTest -Tag @{StackState='Test'} -Select ^Tag
```
**Output:**  

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

### `Copy-APSImage`
<a name="appstream_CopyImage_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio copia un’immagine in un’altra Regione**  

```
Copy-APSImage -DestinationImageName TestImageCopy -DestinationRegion us-west-2 -SourceImageName Powershell
```
**Output:**  

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

### `Disable-APSUSer`
<a name="appstream_DisableUser_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Disable-APSUSer`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio disabilita un utente in USERPOOL**  

```
Disable-APSUser -AuthenticationType USERPOOL -UserName TestUser@lab.com
```
+  Per i dettagli sull'API, vedere [DisableUser](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Enable-APSUser`
<a name="appstream_EnableUser_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Enable-APSUser`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio abilita un utente disabilitato in USERPOOL**  

```
Enable-APSUser -AuthenticationType USERPOOL -UserName TestUser@lab.com
```
+  Per i dettagli sull'API, vedere [EnableUser](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-APSAssociatedFleetList`
<a name="appstream_ListAssociatedFleets_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza il parco associato a uno stack**  

```
Get-APSAssociatedFleetList -StackName PowershellStack
```
**Output:**  

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

### `Get-APSAssociatedStackList`
<a name="appstream_ListAssociatedStacks_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza lo stack associato a un parco**  

```
Get-APSAssociatedStackList -FleetName PowershellFleet
```
**Output:**  

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

### `Get-APSDirectoryConfigList`
<a name="appstream_DescribeDirectoryConfigs_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: Questo esempio visualizza le configurazioni di directory create in AppStream**  

```
Get-APSDirectoryConfigList | Select DirectoryName, OrganizationalUnitDistinguishedNames, CreatedTime
```
**Output:**  

```
DirectoryName OrganizationalUnitDistinguishedNames CreatedTime
------------- ------------------------------------ -----------
Test.com      {OU=AppStream,DC=Test,DC=com}    9/6/2019 10:56:40 AM
contoso.com   {OU=AppStream,OU=contoso,DC=contoso,DC=com}  8/9/2019 9:08:50 AM
```
+  Per i dettagli sull'API, vedere [DescribeDirectoryConfigs](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-APSFleetList`
<a name="appstream_DescribeFleets_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza i dettagli di un parco**  

```
Get-APSFleetList -Name Test
```
**Output:**  

```
Arn                            : arn:aws:appstream:us-east-1:1234567890:fleet/Test
ComputeCapacityStatus          : Amazon.AppStream.Model.ComputeCapacityStatus
CreatedTime                    : 9/12/2019 5:00:45 PM
Description                    : Test
DisconnectTimeoutInSeconds     : 900
DisplayName                    : Test
DomainJoinInfo                 :
EnableDefaultInternetAccess    : False
FleetErrors                    : {}
FleetType                      : ON_DEMAND
IamRoleArn                     :
IdleDisconnectTimeoutInSeconds : 900
ImageArn                       : arn:aws:appstream:us-east-1:1234567890:image/Test
ImageName                      : Test
InstanceType                   : stream.standard.medium
MaxUserDurationInSeconds       : 57600
Name                           : Test
State                          : STOPPED
VpcConfig                      : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [DescribeFleets](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-APSImageBuilderList`
<a name="appstream_DescribeImageBuilders_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio mostra i dettagli di un ImageBuilder**  

```
Get-APSImageBuilderList -Name TestImage
```
**Output:**  

```
AccessEndpoints             : {}
AppstreamAgentVersion       : 06-19-2019
Arn                         : arn:aws:appstream:us-east-1:1234567890:image-builder/TestImage
CreatedTime                 : 1/14/2019 4:33:05 AM
Description                 :
DisplayName                 : TestImage
DomainJoinInfo              :
EnableDefaultInternetAccess : False
IamRoleArn                  :
ImageArn                    : arn:aws:appstream:us-east-1::image/Base-Image-Builder-05-02-2018
ImageBuilderErrors          : {}
InstanceType                : stream.standard.large
Name                        : TestImage
NetworkAccessConfiguration  : Amazon.AppStream.Model.NetworkAccessConfiguration
Platform                    : WINDOWS
State                       : STOPPED
StateChangeReason           :
VpcConfig                   : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [DescribeImageBuilders](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Get-APSImageList`
<a name="appstream_DescribeImages_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio mostra immagini private AppStream **  

```
Get-APSImageList -Type PRIVATE | select DisplayName, ImageBuilderName, Visibility, arn
```
**Output:**  

```
DisplayName          ImageBuilderName      Visibility Arn
-----------          ----------------      ---------- ---
OfficeApps           OfficeApps            PRIVATE    arn:aws:appstream:us-east-1:123456789012:image/OfficeApps
SessionScriptV2      SessionScriptTest     PRIVATE    arn:aws:appstream:us-east-1:123456789012:image/SessionScriptV2
```
+  Per i dettagli sull'API, vedere [DescribeImages](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Get-APSImagePermission`
<a name="appstream_DescribeImagePermissions_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza le autorizzazioni relative alle immagini su un'immagine condivisa AppStream **  

```
Get-APSImagePermission -Name Powershell  | select SharedAccountId, @{n="AllowFleet";e={$_.ImagePermissions.AllowFleet}}, @{n="AllowImageBuilder";e={$_.ImagePermissions.AllowImageBuilder}}
```
**Output:**  

```
SharedAccountId AllowFleet AllowImageBuilder
--------------- ---------- -----------------
123456789012          True              True
```
+  Per i dettagli sull'API, vedere [DescribeImagePermissions](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-APSSessionList`
<a name="appstream_DescribeSessions_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza l’elenco delle sessioni per un parco**  

```
Get-APSSessionList -FleetName PowershellFleet -StackName PowershellStack
```
**Output:**  

```
AuthenticationType         : API
ConnectionState            : CONNECTED
FleetName                  : PowershellFleet
Id                         : d8987c70-4394-4324-a396-2d485c26f2a2
MaxExpirationTime          : 12/27/2019 4:54:07 AM
NetworkAccessConfiguration : Amazon.AppStream.Model.NetworkAccessConfiguration
StackName                  : PowershellStack
StartTime                  : 12/26/2019 12:54:12 PM
State                      : ACTIVE
UserId                     : Test
```
+  Per i dettagli sull'API, vedere [DescribeSessions](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-APSStackList`
<a name="appstream_DescribeStacks_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio mostra un elenco di Stack AppStream **  

```
Get-APSStackList | Select DisplayName, Arn, CreatedTime
```
**Output:**  

```
DisplayName                   Arn                                                                          CreatedTime
-----------                   ---                                                                          -----------
PowershellStack               arn:aws:appstream:us-east-1:123456789012:stack/PowershellStack               4/24/2019 8:49:29 AM
SessionScriptTest             arn:aws:appstream:us-east-1:123456789012:stack/SessionScriptTest             9/12/2019 3:23:12 PM
```
+  Per i dettagli sull'API, vedere [DescribeStacks](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-APSTagsForResourceList`
<a name="appstream_ListTagsForResource_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza i tag su una risorsa AppStream **  

```
Get-APSTagsForResourceList -ResourceArn arn:aws:appstream:us-east-1:123456789012:stack/SessionScriptTest
```
**Output:**  

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

### `Get-APSUsageReportSubscription`
<a name="appstream_DescribeUsageReportSubscriptions_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza i dettagli AppStreamUsageReport di configurazione**  

```
Get-APSUsageReportSubscription
```
**Output:**  

```
LastGeneratedReportDate S3BucketName                                   Schedule SubscriptionErrors
----------------------- ------------                                   -------- ------------------
1/1/0001 12:00:00 AM    appstream-logs-us-east-1-123456789012-sik1hnxe DAILY    {}
```
+  Per i dettagli sull'API, vedere [DescribeUsageReportSubscriptions](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Get-APSUser`
<a name="appstream_DescribeUsers_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza un elenco di utenti con stato abilitato**  

```
Get-APSUser -AuthenticationType USERPOOL | Select-Object UserName, AuthenticationType, Enabled
```
**Output:**  

```
UserName                   AuthenticationType Enabled
--------                   ------------------ -------
foo1@contoso.com USERPOOL              True
foo2@contoso.com        USERPOOL              True
foo3@contoso.com    USERPOOL              True
foo4@contoso.com   USERPOOL              True
foo5@contoso.com         USERPOOL              True
```
+  Per i dettagli sull'API, vedere [DescribeUsers](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Get-APSUserStackAssociation`
<a name="appstream_DescribeUserStackAssociations_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio visualizza l’elenco degli utenti assegnati a uno stack**  

```
Get-APSUserStackAssociation -StackName PowershellStack
```
**Output:**  

```
AuthenticationType SendEmailNotification StackName       UserName
------------------ --------------------- ---------       --------
USERPOOL           False                 PowershellStack TestUser1@lab.com
USERPOOL           False                 PowershellStack TestUser2@lab.com
```
+  Per i dettagli sull'API, vedere [DescribeUserStackAssociations](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `New-APSDirectoryConfig`
<a name="appstream_CreateDirectoryConfig_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: Questo esempio crea una configurazione di directory in AppStream**  

```
New-APSDirectoryConfig -ServiceAccountCredentials_AccountName contoso\ServiceAccount -ServiceAccountCredentials_AccountPassword MyPass -DirectoryName contoso.com -OrganizationalUnitDistinguishedName "OU=AppStream,OU=Contoso,DC=Contoso,DC=com"
```
**Output:**  

```
CreatedTime            DirectoryName OrganizationalUnitDistinguishedNames        ServiceAccountCredentials
-----------            ------------- ------------------------------------        -------------------------
12/27/2019 11:00:30 AM contoso.com   {OU=AppStream,OU=Contoso,DC=Contoso,DC=com} Amazon.AppStream.Model.ServiceAccountCredentials
```
+  Per i dettagli sull'API, vedere [CreateDirectoryConfig](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `New-APSFleet`
<a name="appstream_CreateFleet_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio crea un nuovo parco veicoli AppStream **  

```
New-APSFleet -ComputeCapacity_DesiredInstance 1 -InstanceType stream.standard.medium -Name TestFleet -DisplayName TestFleet -FleetType ON_DEMAND -EnableDefaultInternetAccess $True -VpcConfig_SubnetIds "subnet-123ce32","subnet-a1234cfd" -VpcConfig_SecurityGroupIds sg-4d012a34 -ImageName SessionScriptTest -Region us-west-2
```
**Output:**  

```
Arn                            : arn:aws:appstream:us-west-2:123456789012:fleet/TestFleet
ComputeCapacityStatus          : Amazon.AppStream.Model.ComputeCapacityStatus
CreatedTime                    : 12/27/2019 11:24:42 AM
Description                    :
DisconnectTimeoutInSeconds     : 900
DisplayName                    : TestFleet
DomainJoinInfo                 :
EnableDefaultInternetAccess    : True
FleetErrors                    : {}
FleetType                      : ON_DEMAND
IamRoleArn                     :
IdleDisconnectTimeoutInSeconds : 0
ImageArn                       : arn:aws:appstream:us-west-2:123456789012:image/SessionScriptTest
ImageName                      : SessionScriptTest
InstanceType                   : stream.standard.medium
MaxUserDurationInSeconds       : 57600
Name                           : TestFleet
State                          : STOPPED
VpcConfig                      : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [CreateFleet](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `New-APSImageBuilder`
<a name="appstream_CreateImageBuilder_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: Questo esempio crea un Image Builder in AppStream**  

```
New-APSImageBuilder -InstanceType stream.standard.medium -Name TestIB -DisplayName TestIB -ImageName AppStream-WinServer2012R2-12-12-2019 -EnableDefaultInternetAccess $True -VpcConfig_SubnetId subnet-a1234cfd -VpcConfig_SecurityGroupIds sg-2d012a34 -Region us-west-2
```
**Output:**  

```
AccessEndpoints             : {}
AppstreamAgentVersion       : 12-16-2019
Arn                         : arn:aws:appstream:us-west-2:123456789012:image-builder/TestIB
CreatedTime                 : 12/27/2019 11:39:24 AM
Description                 :
DisplayName                 : TestIB
DomainJoinInfo              :
EnableDefaultInternetAccess : True
IamRoleArn                  :
ImageArn                    : arn:aws:appstream:us-west-2::image/AppStream-WinServer2012R2-12-12-2019
ImageBuilderErrors          : {}
InstanceType                : stream.standard.medium
Name                        : TestIB
NetworkAccessConfiguration  :
Platform                    : WINDOWS
State                       : PENDING
StateChangeReason           :
VpcConfig                   : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [CreateImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `New-APSImageBuilderStreamingURL`
<a name="appstream_CreateImageBuilderStreamingURL_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio crea un URL di ImageBuilder streaming con una validità di 2 ore**  

```
New-APSImageBuilderStreamingURL -Name TestIB -Validity 7200 -Region us-west-2
```
**Output:**  

```
Expires               StreamingURL
-------               ------------
12/27/2019 1:49:13 PM https://appstream2.us-west-2.aws.amazon.com/authenticate?parameters=eyJ0eXBlIjoiQURNSU4iLCJleHBpcmVzIjoiMTU3NzQ1NDU1MyIsImF3c0FjY291bnRJZCI6IjM5MzQwMzgxMTQwNyIsInVzZXJJZCI6ImFkbWluIiwiY2F
```
+  Per i dettagli sull'API, vedere [CreateImageBuilderStreamingURL](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `New-APSStack`
<a name="appstream_CreateStack_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio crea un nuovo stack AppStream **  

```
New-APSStack -Name TestStack -DisplayName TestStack -ApplicationSettings_Enabled $True -ApplicationSettings_SettingsGroup TestStack -Region us-west-2
```
**Output:**  

```
AccessEndpoints     : {}
ApplicationSettings : Amazon.AppStream.Model.ApplicationSettingsResponse
Arn                 : arn:aws:appstream:us-west-2:123456789012:stack/TestStack
CreatedTime         : 12/27/2019 12:34:19 PM
Description         :
DisplayName         : TestStack
EmbedHostDomains    : {}
FeedbackURL         :
Name                : TestStack
RedirectURL         :
StackErrors         : {}
StorageConnectors   : {}
UserSettings        : {Amazon.AppStream.Model.UserSetting, Amazon.AppStream.Model.UserSetting, Amazon.AppStream.Model.UserSetting, Amazon.AppStream.Model.UserSetting}
```
+  Per i dettagli sull'API, vedere [CreateStack](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `New-APSStreamingURL`
<a name="appstream_CreateStreamingURL_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio crea un URL di streaming per lo stack**  

```
New-APSStreamingURL -StackName SessionScriptTest -FleetName SessionScriptNew -UserId TestUser
```
**Output:**  

```
Expires                StreamingURL
-------                ------------
12/27/2019 12:43:37 PM https://appstream2.us-east-1.aws.amazon.com/authenticate?parameters=eyJ0eXBlIjoiRU5EX1VTRVIiLCJleHBpcmVzIjoiMTU3NzQ1MDYxNyIsImF3c0FjY291bnRJZCI6IjM5MzQwMzgxMTQwNyIsInVzZXJJZCI6IlRlc3RVc2
```
+  Per i dettagli sull'API, vedere [CreateStreamingURL](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `New-APSUsageReportSubscription`
<a name="appstream_CreateUsageReportSubscription_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio abilita i report di AppStream utilizzo**  

```
New-APSUsageReportSubscription
```
**Output:**  

```
S3BucketName                                   Schedule
------------                                   --------
appstream-logs-us-east-1-123456789012-sik2hnxe DAILY
```
+  Per i dettagli sull'API, vedere [CreateUsageReportSubscription](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `New-APSUser`
<a name="appstream_CreateUser_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio crea un utente in USERPOOL**  

```
New-APSUser -UserName Test@lab.com -AuthenticationType USERPOOL -FirstName 'kt' -LastName 'aws' -Select ^UserName
```
**Output:**  

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

### `Register-APSFleet`
<a name="appstream_AssociateFleet_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio registra il parco con uno stack**  

```
Register-APSFleet -StackName TestStack -FleetName TestFleet -Region us-west-2
```
+  Per i dettagli sull'API, vedere [AssociateFleet](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Register-APSUserStackBatch`
<a name="appstream_BatchAssociateUserStack_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio assegna lo stack a un utente in USERPOOL**  

```
Register-APSUserStackBatch -UserStackAssociation @{AuthenticationType="USERPOOL";SendEmailNotification=$False;StackName="PowershellStack";UserName="TestUser1@lab.com"}
```
+  Per i dettagli sull'API, vedere [BatchAssociateUserStack](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Remove-APSDirectoryConfig`
<a name="appstream_DeleteDirectoryConfig_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio rimuove la configurazione della AppStream directory**  

```
Remove-APSDirectoryConfig -DirectoryName contoso.com
```
**Output:**  

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

### `Remove-APSFleet`
<a name="appstream_DeleteFleet_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio rimuove le eliminazioni di un gruppo AppStream **  

```
Remove-APSFleet -Name TestFleet -Region us-west-2
```
**Output:**  

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

### `Remove-APSImage`
<a name="appstream_DeleteImage_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio elimina un’immagine**  

```
Remove-APSImage -Name TestImage -Region us-west-2
```
**Output:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-APSImage (DeleteImage)" on target "TestImage".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): A

Applications                : {}
AppstreamAgentVersion       : LATEST
Arn                         : arn:aws:appstream:us-west-2:123456789012:image/TestImage
BaseImageArn                :
CreatedTime                 : 12/27/2019 1:34:10 PM
Description                 :
DisplayName                 : TestImage
ImageBuilderName            :
ImageBuilderSupported       : True
ImagePermissions            :
Name                        : TestImage
Platform                    : WINDOWS
PublicBaseImageReleasedDate : 6/12/2018 12:00:00 AM
State                       : AVAILABLE
StateChangeReason           :
Visibility                  : PRIVATE
```
+  Per i dettagli sull'API, vedere [DeleteImage](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Remove-APSImageBuilder`
<a name="appstream_DeleteImageBuilder_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio elimina un ImageBuilder**  

```
Remove-APSImageBuilder -Name TestIB -Region us-west-2
```
**Output:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-APSImageBuilder (DeleteImageBuilder)" on target "TestIB".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): A

AccessEndpoints             : {}
AppstreamAgentVersion       : 12-16-2019
Arn                         : arn:aws:appstream:us-west-2:123456789012:image-builder/TestIB
CreatedTime                 : 12/27/2019 11:39:24 AM
Description                 :
DisplayName                 : TestIB
DomainJoinInfo              :
EnableDefaultInternetAccess : True
IamRoleArn                  :
ImageArn                    : arn:aws:appstream:us-west-2::image/AppStream-WinServer2012R2-12-12-2019
ImageBuilderErrors          : {}
InstanceType                : stream.standard.medium
Name                        : TestIB
NetworkAccessConfiguration  : Amazon.AppStream.Model.NetworkAccessConfiguration
Platform                    : WINDOWS
State                       : DELETING
StateChangeReason           :
VpcConfig                   : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [DeleteImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Remove-APSImagePermission`
<a name="appstream_DeleteImagePermissions_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio rimuove le autorizzazioni di un’immagine**  

```
Remove-APSImagePermission -Name Powershell -SharedAccountId 123456789012
```
**Output:**  

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

### `Remove-APSResourceTag`
<a name="appstream_UntagResource_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio rimuove un tag di risorsa dalla AppStream risorsa**  

```
Remove-APSResourceTag -ResourceArn arn:aws:appstream:us-east-1:123456789012:stack/SessionScriptTest -TagKey StackState
```
**Output:**  

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

### `Remove-APSStack`
<a name="appstream_DeleteStack_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio elimina uno stack**  

```
Remove-APSStack -Name TestStack -Region us-west-2
```
**Output:**  

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

### `Remove-APSUsageReportSubscription`
<a name="appstream_DeleteUsageReportSubscription_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio disattiva l'abbonamento a AppStream Usage Report**  

```
Remove-APSUsageReportSubscription
```
**Output:**  

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

### `Remove-APSUser`
<a name="appstream_DeleteUser_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio elimina un utente da USERPOOL**  

```
Remove-APSUser -UserName TestUser@lab.com -AuthenticationType USERPOOL
```
**Output:**  

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

### `Revoke-APSSession`
<a name="appstream_ExpireSession_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Revoke-APSSession`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio revoca una sessione a fleet AppStream **  

```
Revoke-APSSession -SessionId 6cd2f9a3-f948-4aa1-8014-8a7dcde14877
```
+  Per i dettagli sull'API, vedere [ExpireSession](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference* (V5). 

### `Start-APSFleet`
<a name="appstream_StartFleet_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Start-APSFleet`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio avvia un parco**  

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

### `Start-APSImageBuilder`
<a name="appstream_StartImageBuilder_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Start-APSImageBuilder`

**Strumenti per PowerShell V5**  
**Esempio 1: Questo esempio avvia un ImageBuilder**  

```
Start-APSImageBuilder -Name TestImage
```
**Output:**  

```
AccessEndpoints             : {}
AppstreamAgentVersion       : 06-19-2019
Arn                         : arn:aws:appstream:us-east-1:123456789012:image-builder/TestImage
CreatedTime                 : 1/14/2019 4:33:05 AM
Description                 :
DisplayName                 : TestImage
DomainJoinInfo              :
EnableDefaultInternetAccess : False
IamRoleArn                  :
ImageArn                    : arn:aws:appstream:us-east-1::image/Base-Image-Builder-05-02-2018
ImageBuilderErrors          : {}
InstanceType                : stream.standard.large
Name                        : TestImage
NetworkAccessConfiguration  : Amazon.AppStream.Model.NetworkAccessConfiguration
Platform                    : WINDOWS
State                       : PENDING
StateChangeReason           :
VpcConfig                   : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [StartImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Stop-APSFleet`
<a name="appstream_StopFleet_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio arresta un parco**  

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

### `Stop-APSImageBuilder`
<a name="appstream_StopImageBuilder_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio interrompe un ImageBuilder**  

```
Stop-APSImageBuilder -Name TestImage
```
**Output:**  

```
AccessEndpoints             : {}
AppstreamAgentVersion       : 06-19-2019
Arn                         : arn:aws:appstream:us-east-1:123456789012:image-builder/TestImage
CreatedTime                 : 1/14/2019 4:33:05 AM
Description                 :
DisplayName                 : TestImage
DomainJoinInfo              :
EnableDefaultInternetAccess : False
IamRoleArn                  :
ImageArn                    : arn:aws:appstream:us-east-1::image/Base-Image-Builder-05-02-2018
ImageBuilderErrors          : {}
InstanceType                : stream.standard.large
Name                        : TestImage
NetworkAccessConfiguration  : Amazon.AppStream.Model.NetworkAccessConfiguration
Platform                    : WINDOWS
State                       : STOPPING
StateChangeReason           :
VpcConfig                   : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [StopImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Unregister-APSFleet`
<a name="appstream_DisassociateFleet_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio annulla la registrazione di un parco in uno stack**  

```
Unregister-APSFleet -StackName TestStack -FleetName TestFleet -Region us-west-2
```
+  Per i dettagli sull'API, vedere [DisassociateFleet](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Unregister-APSUserStackBatch`
<a name="appstream_BatchDisassociateUserStack_powershell_5_topic"></a>

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

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio rimuove un utente da uno stack assegnato**  

```
Unregister-APSUserStackBatch -UserStackAssociation @{AuthenticationType="USERPOOL";SendEmailNotification=$False;StackName="PowershellStack";UserName="TestUser1@lab.com"}
```
+  Per i dettagli sull'API, vedere [BatchDisassociateUserStack](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Update-APSDirectoryConfig`
<a name="appstream_UpdateDirectoryConfig_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Update-APSDirectoryConfig`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio aggiorna la configurazione della directory creata in AppStream**  

```
Update-APSDirectoryConfig -ServiceAccountCredentials_AccountName contoso\ServiceAccount -ServiceAccountCredentials_AccountPassword MyPass@1$@# -DirectoryName contoso.com -OrganizationalUnitDistinguishedName "OU=AppStreamNew,OU=Contoso,DC=Contoso,DC=com"
```
**Output:**  

```
CreatedTime           DirectoryName OrganizationalUnitDistinguishedNames           ServiceAccountCredentials
-----------           ------------- ------------------------------------           -------------------------
12/27/2019 3:50:02 PM contoso.com   {OU=AppStreamNew,OU=Contoso,DC=Contoso,DC=com} Amazon.AppStream.Model.ServiceAccountCredentials
```
+  Per i dettagli sull'API, vedere [UpdateDirectoryConfig](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Update-APSFleet`
<a name="appstream_UpdateFleet_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Update-APSFleet`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio aggiorna le proprietà di un parco**  

```
Update-APSFleet -Name PowershellFleet -EnableDefaultInternetAccess $True -DisconnectTimeoutInSecond 950
```
**Output:**  

```
Arn                            : arn:aws:appstream:us-east-1:123456789012:fleet/PowershellFleet
ComputeCapacityStatus          : Amazon.AppStream.Model.ComputeCapacityStatus
CreatedTime                    : 4/24/2019 8:39:41 AM
Description                    : PowershellFleet
DisconnectTimeoutInSeconds     : 950
DisplayName                    : PowershellFleet
DomainJoinInfo                 :
EnableDefaultInternetAccess    : True
FleetErrors                    : {}
FleetType                      : ON_DEMAND
IamRoleArn                     :
IdleDisconnectTimeoutInSeconds : 900
ImageArn                       : arn:aws:appstream:us-east-1:123456789012:image/Powershell
ImageName                      : Powershell
InstanceType                   : stream.standard.medium
MaxUserDurationInSeconds       : 57600
Name                           : PowershellFleet
State                          : STOPPED
VpcConfig                      : Amazon.AppStream.Model.VpcConfig
```
+  Per i dettagli sull'API, vedere [UpdateFleet](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

### `Update-APSImagePermission`
<a name="appstream_UpdateImagePermissions_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Update-APSImagePermission`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio condivide un' AppStream immagine con un altro account**  

```
Update-APSImagePermission -Name Powershell -SharedAccountId 123456789012 -ImagePermissions_AllowFleet $True -ImagePermissions_AllowImageBuilder $True
```
+  Per i dettagli sull'API, vedere [UpdateImagePermissions](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (V5)*. 

### `Update-APSStack`
<a name="appstream_UpdateStack_powershell_5_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `Update-APSStack`

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio aggiorna (abilita) la persistenza delle impostazioni dell’applicazione e le cartelle Home in uno stack**  

```
Update-APSStack -Name PowershellStack -ApplicationSettings_Enabled $True -ApplicationSettings_SettingsGroup PowershellStack -StorageConnector @{ConnectorType="HOMEFOLDERS"}
```
**Output:**  

```
AccessEndpoints     : {}
ApplicationSettings : Amazon.AppStream.Model.ApplicationSettingsResponse
Arn                 : arn:aws:appstream:us-east-1:123456789012:stack/PowershellStack
CreatedTime         : 4/24/2019 8:49:29 AM
Description         : PowershellStack
DisplayName         : PowershellStack
EmbedHostDomains    : {}
FeedbackURL         :
Name                : PowershellStack
RedirectURL         :
StackErrors         : {}
StorageConnectors   : {Amazon.AppStream.Model.StorageConnector, Amazon.AppStream.Model.StorageConnector}
UserSettings        : {Amazon.AppStream.Model.UserSetting, Amazon.AppStream.Model.UserSetting, Amazon.AppStream.Model.UserSetting, Amazon.AppStream.Model.UserSetting}
```
+  Per i dettagli sull'API, vedere [UpdateStack](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 