

Versi 5 (V5) dari Alat AWS untuk PowerShell telah dirilis\$1

Untuk informasi tentang melanggar perubahan dan memigrasi aplikasi Anda, lihat [topik migrasi](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html).

 [https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html)

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

# WorkSpaces Contoh aplikasi menggunakan Alat untuk PowerShell V5
<a name="powershell_appstream_code_examples"></a>

Contoh kode berikut menunjukkan cara melakukan tindakan dan mengimplementasikan skenario umum dengan menggunakan Alat AWS untuk PowerShell V5 dengan WorkSpaces Aplikasi.

*Tindakan* merupakan kutipan kode dari program yang lebih besar dan harus dijalankan dalam konteks. Sementara tindakan menunjukkan cara memanggil fungsi layanan individual, Anda dapat melihat tindakan dalam konteks dalam skenario terkait.

Setiap contoh menyertakan tautan ke kode sumber lengkap, di mana Anda dapat menemukan instruksi tentang cara mengatur dan menjalankan kode dalam konteks.

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

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

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

Contoh kode berikut menunjukkan cara menggunakan`Add-APSResourceTag`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menambahkan Tag sumber daya ke AppStream sumber daya**  

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

```
Name                           Value
----                           -----
StackState                     Test
```
+  Untuk detail API, lihat [TagResource](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Copy-APSImage`.

**Alat untuk PowerShell V5**  
**Contoh 1: Sampel ini menyalin gambar ke wilayah lain**  

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

```
TestImageCopy
```
+  Untuk detail API, lihat [CopyImage](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Disable-APSUSer`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menonaktifkan pengguna di USERPOOL**  

```
Disable-APSUser -AuthenticationType USERPOOL -UserName TestUser@lab.com
```
+  Untuk detail API, lihat [DisableUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Enable-APSUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memungkinkan pengguna yang dinonaktifkan di USERPOOL**  

```
Enable-APSUser -AuthenticationType USERPOOL -UserName TestUser@lab.com
```
+  Untuk detail API, lihat [EnableUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSAssociatedFleetList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan armada yang terkait dengan tumpukan**  

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

```
PowershellFleet
```
+  Untuk detail API, lihat [ListAssociatedFleets](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSAssociatedStackList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan tumpukan yang terkait dengan armada**  

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

```
PowershellStack
```
+  Untuk detail API, lihat [ListAssociatedStacks](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSDirectoryConfigList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan Konfigurasi Direktori yang dibuat 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
```
+  Untuk detail API, lihat [DescribeDirectoryConfigs](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSFleetList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan detail armada**  

```
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
```
+  Untuk detail API, lihat [DescribeFleets](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSImageBuilderList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan rincian dari sebuah 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
```
+  Untuk detail API, lihat [DescribeImageBuilders](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSImageList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan AppStream Gambar pribadi**  

```
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
```
+  Untuk detail API, lihat [DescribeImages](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSImagePermission`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan izin Gambar pada Gambar bersama AppStream **  

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

```
SharedAccountId AllowFleet AllowImageBuilder
--------------- ---------- -----------------
123456789012          True              True
```
+  Untuk detail API, lihat [DescribeImagePermissions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSSessionList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan daftar sesi ke armada**  

```
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
```
+  Untuk detail API, lihat [DescribeSessions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSStackList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan daftar AppStream Stack**  

```
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
```
+  Untuk detail API, lihat [DescribeStacks](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSTagsForResourceList`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan tag pada sumber AppStream daya**  

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

```
Key        Value
---        -----
StackState Test
```
+  Untuk detail API, lihat [ListTagsForResource](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSUsageReportSubscription`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan detail AppStreamUsageReport konfigurasi**  

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

```
LastGeneratedReportDate S3BucketName                                   Schedule SubscriptionErrors
----------------------- ------------                                   -------- ------------------
1/1/0001 12:00:00 AM    appstream-logs-us-east-1-123456789012-sik1hnxe DAILY    {}
```
+  Untuk detail API, lihat [DescribeUsageReportSubscriptions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan daftar pengguna dengan status diaktifkan**  

```
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
```
+  Untuk detail API, lihat [DescribeUsers](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Get-APSUserStackAssociation`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menampilkan daftar pengguna yang ditugaskan ke tumpukan**  

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

```
AuthenticationType SendEmailNotification StackName       UserName
------------------ --------------------- ---------       --------
USERPOOL           False                 PowershellStack TestUser1@lab.com
USERPOOL           False                 PowershellStack TestUser2@lab.com
```
+  Untuk detail API, lihat [DescribeUserStackAssociations](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSDirectoryConfig`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat konfigurasi direktori di 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
```
+  Untuk detail API, lihat [CreateDirectoryConfig](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSFleet`.

**Alat untuk PowerShell V5**  
**Contoh 1: Sampel ini membuat AppStream armada baru**  

```
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
```
+  Untuk detail API, lihat [CreateFleet](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSImageBuilder`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat Image Builder di 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
```
+  Untuk detail API, lihat [CreateImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSImageBuilderStreamingURL`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat URL ImageBuilder streaming dengan validitas 2 jam**  

```
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
```
+  Untuk detail API, lihat [CreateImageBuilderStreamingURL](https://docs.aws.amazon.com/powershell/v5/reference) di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSStack`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat AppStream Stack baru**  

```
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}
```
+  Untuk detail API, lihat [CreateStack](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSStreamingURL`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat URL streaming 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
```
+  Untuk detail API, lihat [CreateStreamingURL](https://docs.aws.amazon.com/powershell/v5/reference) di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSUsageReportSubscription`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengaktifkan Laporan AppStream Penggunaan**  

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

```
S3BucketName                                   Schedule
------------                                   --------
appstream-logs-us-east-1-123456789012-sik2hnxe DAILY
```
+  Untuk detail API, lihat [CreateUsageReportSubscription](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`New-APSUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat pengguna di USERPOOL**  

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

```
Test@lab.com
```
+  Untuk detail API, lihat [CreateUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Register-APSFleet`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendaftarkan armada dengan tumpukan**  

```
Register-APSFleet -StackName TestStack -FleetName TestFleet -Region us-west-2
```
+  Untuk detail API, lihat [AssociateFleet](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Register-APSUserStackBatch`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menetapkan tumpukan ke pengguna di USERPOOL**  

```
Register-APSUserStackBatch -UserStackAssociation @{AuthenticationType="USERPOOL";SendEmailNotification=$False;StackName="PowershellStack";UserName="TestUser1@lab.com"}
```
+  Untuk detail API, lihat [BatchAssociateUserStack](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSDirectoryConfig`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus konfigurasi AppStream Direktori**  

```
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
```
+  Untuk detail API, lihat [DeleteDirectoryConfig](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSFleet`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus menghapus armada 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
```
+  Untuk detail API, lihat [DeleteFleet](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSImage`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus Gambar**  

```
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
```
+  Untuk detail API, lihat [DeleteImage](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSImageBuilder`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus 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
```
+  Untuk detail API, lihat [DeleteImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSImagePermission`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus izin Gambar**  

```
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
```
+  Untuk detail API, lihat [DeleteImagePermissions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSResourceTag`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus tag sumber daya dari AppStream sumber daya**  

```
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
```
+  Untuk detail API, lihat [UntagResource](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSStack`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus 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
```
+  Untuk detail API, lihat [DeleteStack](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSUsageReportSubscription`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menonaktifkan langganan Laporan AppStream Penggunaan**  

```
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
```
+  Untuk detail API, lihat [DeleteUsageReportSubscription](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Remove-APSUser`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus pengguna dari 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
```
+  Untuk detail API, lihat [DeleteUser](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Revoke-APSSession`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mencabut sesi ke AppStream armada**  

```
Revoke-APSSession -SessionId 6cd2f9a3-f948-4aa1-8014-8a7dcde14877
```
+  Untuk detail API, lihat [ExpireSession](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Start-APSFleet`.

**Alat untuk PowerShell V5**  
**Contoh 1: Sampel ini memulai armada**  

```
Start-APSFleet -Name PowershellFleet
```
+  Untuk detail API, lihat [StartFleet](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Start-APSImageBuilder`.

**Alat untuk PowerShell V5**  
**Contoh 1: Sampel ini memulai 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
```
+  Untuk detail API, lihat [StartImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Stop-APSFleet`.

**Alat untuk PowerShell V5**  
**Contoh 1: Sampel ini menghentikan armada**  

```
Stop-APSFleet -Name PowershellFleet
```
+  Untuk detail API, lihat [StopFleet](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Stop-APSImageBuilder`.

**Alat untuk PowerShell V5**  
**Contoh 1: Sampel ini menghentikan 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
```
+  Untuk detail API, lihat [StopImageBuilder](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Unregister-APSFleet`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membatalkan registrasi armada dari tumpukan**  

```
Unregister-APSFleet -StackName TestStack -FleetName TestFleet -Region us-west-2
```
+  Untuk detail API, lihat [DisassociateFleet](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Unregister-APSUserStackBatch`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus pengguna dari Stack yang ditetapkan**  

```
Unregister-APSUserStackBatch -UserStackAssociation @{AuthenticationType="USERPOOL";SendEmailNotification=$False;StackName="PowershellStack";UserName="TestUser1@lab.com"}
```
+  Untuk detail API, lihat [BatchDisassociateUserStack](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Update-APSDirectoryConfig`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui konfigurasi Direktori yang dibuat di 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
```
+  Untuk detail API, lihat [UpdateDirectoryConfig](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Update-APSFleet`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui properti armada**  

```
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
```
+  Untuk detail API, lihat [UpdateFleet](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Update-APSImagePermission`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membagikan AppStream Gambar dengan akun lain**  

```
Update-APSImagePermission -Name Powershell -SharedAccountId 123456789012 -ImagePermissions_AllowFleet $True -ImagePermissions_AllowImageBuilder $True
```
+  Untuk detail API, lihat [UpdateImagePermissions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

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

Contoh kode berikut menunjukkan cara menggunakan`Update-APSStack`.

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini memperbarui (mengaktifkan) Persistensi pengaturan aplikasi dan Folder Home pada 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}
```
+  Untuk detail API, lihat [UpdateStack](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 