Versi 5 (V5) Alat AWS untuk PowerShell telah dirilis!
Untuk informasi tentang mengubah perubahan dan memigrasikan aplikasi Anda, lihat topik https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html migrasi.
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
WorkSpaces Contoh aplikasi menggunakan Tools for PowerShell V5
Contoh kode berikut menunjukkan cara melakukan tindakan dan menerapkan 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.
Topik
Tindakan
Contoh kode berikut menunjukkan cara menggunakanAdd-APSResourceTag.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel 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 ^TagOutput:
Name Value ---- ----- StackState Test-
Untuk detail API, lihat TagResource di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanCopy-APSImage.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menyalin gambar ke wilayah lain
Copy-APSImage -DestinationImageName TestImageCopy -DestinationRegion us-west-2 -SourceImageName PowershellOutput:
TestImageCopy-
Untuk detail API, lihat CopyImage di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanDisable-APSUSer.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menonaktifkan pengguna di USERPOOL
Disable-APSUser -AuthenticationType USERPOOL -UserName TestUser@lab.com-
Untuk detail API, lihat DisableUser di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanEnable-APSUser.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini memungkinkan pengguna yang dinonaktifkan di USERPOOL
Enable-APSUser -AuthenticationType USERPOOL -UserName TestUser@lab.com-
Untuk detail API, lihat EnableUser di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSAssociatedFleetList.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menampilkan armada yang terkait dengan tumpukan
Get-APSAssociatedFleetList -StackName PowershellStackOutput:
PowershellFleet-
Untuk detail API, lihat ListAssociatedFleets di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSAssociatedStackList.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menampilkan tumpukan yang terkait dengan armada
Get-APSAssociatedStackList -FleetName PowershellFleetOutput:
PowershellStack-
Untuk detail API, lihat ListAssociatedStacks di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSDirectoryConfigList.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menampilkan Konfigurasi Direktori yang dibuat di AppStream
Get-APSDirectoryConfigList | Select DirectoryName, OrganizationalUnitDistinguishedNames, CreatedTimeOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSFleetList.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menampilkan rincian armada
Get-APSFleetList -Name TestOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSImageBuilderList.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menampilkan detail dari ImageBuilder
Get-APSImageBuilderList -Name TestImageOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSImageList.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menampilkan AppStream Gambar pribadi
Get-APSImageList -Type PRIVATE | select DisplayName, ImageBuilderName, Visibility, arnOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSImagePermission.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menampilkan izin Gambar pada AppStream Gambar bersama
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSSessionList.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menampilkan daftar sesi ke armada
Get-APSSessionList -FleetName PowershellFleet -StackName PowershellStackOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSStackList.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menampilkan daftar AppStream Stack
Get-APSStackList | Select DisplayName, Arn, CreatedTimeOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSTagsForResourceList.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menampilkan tag pada AppStream sumber daya
Get-APSTagsForResourceList -ResourceArn arn:aws:appstream:us-east-1:123456789012:stack/SessionScriptTestOutput:
Key Value --- ----- StackState Test-
Untuk detail API, lihat ListTagsForResource di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSUsageReportSubscription.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menampilkan detail AppStreamUsageReport konfigurasi
Get-APSUsageReportSubscriptionOutput:
LastGeneratedReportDate S3BucketName Schedule SubscriptionErrors ----------------------- ------------ -------- ------------------ 1/1/0001 12:00:00 AM appstream-logs-us-east-1-123456789012-sik1hnxe DAILY {}-
Untuk detail API, lihat DescribeUsageReportSubscriptions di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSUser.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menampilkan daftar pengguna dengan status diaktifkan
Get-APSUser -AuthenticationType USERPOOL | Select-Object UserName, AuthenticationType, EnabledOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanGet-APSUserStackAssociation.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menampilkan daftar pengguna yang ditugaskan ke tumpukan
Get-APSUserStackAssociation -StackName PowershellStackOutput:
AuthenticationType SendEmailNotification StackName UserName ------------------ --------------------- --------- -------- USERPOOL False PowershellStack TestUser1@lab.com USERPOOL False PowershellStack TestUser2@lab.com-
Untuk detail API, lihat DescribeUserStackAssociations di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-APSDirectoryConfig.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-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-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-APSImageBuilder.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini membuat Pembuat Gambar 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-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-APSImageBuilderStreamingURL.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini membuat URL ImageBuilder streaming dengan validitas 2 jam
New-APSImageBuilderStreamingURL -Name TestIB -Validity 7200 -Region us-west-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-APSStack.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini membuat AppStream Stack baru
New-APSStack -Name TestStack -DisplayName TestStack -ApplicationSettings_Enabled $True -ApplicationSettings_SettingsGroup TestStack -Region us-west-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-APSStreamingURL.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini membuat URL streaming Stack
New-APSStreamingURL -StackName SessionScriptTest -FleetName SessionScriptNew -UserId TestUserOutput:
Expires StreamingURL ------- ------------ 12/27/2019 12:43:37 PM https://appstream2.us-east-1.aws.amazon.com/authenticate?parameters=eyJ0eXBlIjoiRU5EX1VTRVIiLCJleHBpcmVzIjoiMTU3NzQ1MDYxNyIsImF3c0FjY291bnRJZCI6IjM5MzQwMzgxMTQwNyIsInVzZXJJZCI6IlRlc3RVc2-
Untuk detail API, lihat CreateStreaming URL di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-APSUsageReportSubscription.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini mengaktifkan AppStream Laporan Penggunaan
New-APSUsageReportSubscriptionOutput:
S3BucketName Schedule ------------ -------- appstream-logs-us-east-1-123456789012-sik2hnxe DAILY-
Untuk detail API, lihat CreateUsageReportSubscription di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanNew-APSUser.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini membuat pengguna di USERPOOL
New-APSUser -UserName Test@lab.com -AuthenticationType USERPOOL -FirstName 'kt' -LastName 'aws' -Select ^UserNameOutput:
Test@lab.com-
Untuk detail API, lihat CreateUser di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRegister-APSFleet.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini mendaftarkan armada dengan tumpukan
Register-APSFleet -StackName TestStack -FleetName TestFleet -Region us-west-2-
Untuk detail API, lihat AssociateFleet di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRegister-APSUserStackBatch.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSDirectoryConfig.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus konfigurasi AppStream Direktori
Remove-APSDirectoryConfig -DirectoryName contoso.comOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSFleet.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus menghapus armada AppStream
Remove-APSFleet -Name TestFleet -Region us-west-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSImage.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus Gambar
Remove-APSImage -Name TestImage -Region us-west-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSImageBuilder.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus ImageBuilder
Remove-APSImageBuilder -Name TestIB -Region us-west-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSImagePermission.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus izin Gambar
Remove-APSImagePermission -Name Powershell -SharedAccountId 123456789012Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSResourceTag.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus tag sumber daya dari AppStream sumber daya
Remove-APSResourceTag -ResourceArn arn:aws:appstream:us-east-1:123456789012:stack/SessionScriptTest -TagKey StackStateOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSStack.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus Stack
Remove-APSStack -Name TestStack -Region us-west-2Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSUsageReportSubscription.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menonaktifkan langganan AppStream Laporan Penggunaan
Remove-APSUsageReportSubscriptionOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRemove-APSUser.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghapus pengguna dari USERPOOL
Remove-APSUser -UserName TestUser@lab.com -AuthenticationType USERPOOLOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanRevoke-APSSession.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini mencabut sesi ke armada AppStream
Revoke-APSSession -SessionId 6cd2f9a3-f948-4aa1-8014-8a7dcde14877-
Untuk detail API, lihat ExpireSession di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanStart-APSFleet.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini memulai armada
Start-APSFleet -Name PowershellFleet-
Untuk detail API, lihat StartFleet di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanStart-APSImageBuilder.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini memulai sebuah ImageBuilder
Start-APSImageBuilder -Name TestImageOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanStop-APSFleet.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghentikan armada
Stop-APSFleet -Name PowershellFleet-
Untuk detail API, lihat StopFleet di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanStop-APSImageBuilder.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini menghentikan ImageBuilder
Stop-APSImageBuilder -Name TestImageOutput:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanUnregister-APSFleet.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini membatalkan pendaftaran armada dari tumpukan
Unregister-APSFleet -StackName TestStack -FleetName TestFleet -Region us-west-2-
Untuk detail API, lihat DisassociateFleet di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanUnregister-APSUserStackBatch.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanUpdate-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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanUpdate-APSFleet.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini memperbarui properti armada
Update-APSFleet -Name PowershellFleet -EnableDefaultInternetAccess $True -DisconnectTimeoutInSecond 950Output:
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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanUpdate-APSImagePermission.
- Alat untuk PowerShell V5
-
Contoh 1: Sampel ini membagikan AppStream Gambar dengan akun lain
Update-APSImagePermission -Name Powershell -SharedAccountId 123456789012 -ImagePermissions_AllowFleet $True -ImagePermissions_AllowImageBuilder $True-
Untuk detail API, lihat UpdateImagePermissions di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Contoh kode berikut menunjukkan cara menggunakanUpdate-APSStack.
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini memperbarui (mengaktifkan) persistensi pengaturan aplikasi dan Folder Beranda 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 di Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-