CARVIEW |
Select Language
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 4515
Connection: keep-alive
Date: Wed, 23 Jul 2025 10:19:56 GMT
Content-Encoding: gzip
Server: Server
Cache-Control: no-store, no-cache, must-revalidate
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=47304000; includeSubDomains
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
Content-Security-Policy: upgrade-insecure-requests; script-src 'self' 'unsafe-inline' *.awsstatic.com *.cdn.uis.awsstatic.com *.cdn.console.awsstatic.com d2c.aws.amazon.com a0.awsstatic.com *.feedback.console.aws.dev insights.docs.aws.com wss://insights.docs.aws.com/prod; object-src 'none';
Last-Modified: Tue, 22 Jul 2025 21:00:12 GMT
ETag: "9r1e8eLyb8tg0OaAR9DPpDHJ9gw=-gzip"
Accept-Ranges: bytes
Vary: Accept-Encoding
X-Cache: Miss from cloudfront
Via: 1.1 853b5be3b78b835fb7185ce90c946656.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: BOM78-P5
X-Amz-Cf-Id: bxy83yNoVsLBsiIOKE-a0-L9pImVwbDnNgMeARXCTBkIw66CR3YjpA==
SimpleSystemsManagement: Get-SSMLatestEC2Image Cmdlet | AWS Tools for PowerShell
AWS Tools for Windows PowerShell
Command Reference
AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Get-SSMLatestEC2Image Cmdlet
AWS Systems ManagerAvailable in AWS.Tools.SimpleSystemsManagement, AWSPowerShell.NetCore and AWSPowerShell
Synopsis
Retrieves the latest EC2 AMIs (Amazon Machine Images) from AWS Systems Manager parameters by calling Get-SSMParametersByPath or Get-SSMParameterValue.
Syntax
Get-SSMLatestEC2Image-Path <String>-ImageName <String>-ClientConfig <AmazonSimpleSystemsManagementConfig>
Description
Retrieves the latest EC2 AMIs (Amazon Machine Images) from AWS Systems Manager parameters by calling Get-SSMParametersByPath or Get-SSMParameterValue.
Parameters
-ClientConfig <AmazonSimpleSystemsManagementConfig>
Amazon.PowerShell.Cmdlets.SSM.AmazonSimpleSystemsManagementClientCmdlet.ClientConfig
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
-ImageName <String>
The name of the parameter containing the image information. Wildcard characters '*' and '?' can be used to filter multiple AMIs.
Required? | False |
Position? | 2 |
Accept pipeline input? | True (ByPropertyName) |
-Path <String>
The partial hierarchy for the parameter under the /aws/service/ prefix representing the type of images to list.
Required? | True |
Position? | 1 |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Common Credential and Region Parameters
-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
Outputs
PSObject or System.String
This cmdlet returns a collection of PSObjects when listing AMIs. When -ImageName is specified without using wildcard characters, the cmdlet returns only the AMI's identifier as a string.
The service call response (type Amazon.SimpleSystemsManagement.Model.GetParametersByPathResponse or Amazon.SimpleSystemsManagement.Model.GetParametersResponse) can be returned by specifying '-Select *'.
Examples
Example 1
PS Get-SSMLatestEC2Image -Path ami-windows-latest
Name Value
---- -----
Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Express ami-0e5ddd288daff4fab
Windows_Server-2012-R2_RTM-Chinese_Simplified-64Bit-Base ami-0c5ea64e6bec1cb50
Windows_Server-2012-R2_RTM-Chinese_Traditional-64Bit-Base ami-09775eff0bf8c113d
Windows_Server-2012-R2_RTM-Dutch-64Bit-Base ami-025064b67e28cf5df
...This example lists all the lastest Windows AMIs.
Example 2
PS Get-SSMLatestEC2Image -Path ami-amazon-linux-latest -ImageName amzn-ami-hvm-x86_64-ebs -Region us-west-2
ami-09b92cd132204c704This example retrieves the AMI id of a specific Amazon Linux image for the us-west-2 region.
Example 3
Get-SSMLatestEC2Image -Path ami-windows-latest -ImageName *Windows*2019*English*
Name Value
---- -----
Windows_Server-2019-English-Full-SQL_2017_Web ami-085e9d27da5b73a42
Windows_Server-2019-English-STIG-Core ami-0bfd85c29148c7f80
Windows_Server-2019-English-Full-SQL_2019_Web ami-02099560d7fb11f20
Windows_Server-2019-English-Full-SQL_2016_SP2_Standard ami-0d7ae2d81c07bd598
...This example lists all the lastest Windows AMIs matching the specified wildcard expression.
Related Links
Supported Version
AWS Tools for PowerShell: 2.x.y.z