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.

Synopsis

Calls the AWS Systems Manager DescribeAvailablePatches API operation.

Syntax

Get-SSMAvailablePatch
-Filter <PatchOrchestratorFilter[]>
-MaxResult <Int32>
-NextToken <String>
-Select <String>
-NoAutoIteration <SwitchParameter>
-ClientConfig <AmazonSimpleSystemsManagementConfig>

Description

Lists all patches eligible to be included in a patch baseline. Currently, DescribeAvailablePatches supports only the Amazon Linux 1, Amazon Linux 2, and Windows Server operating systems.

This cmdlet automatically pages all available results to the pipeline - parameters related to iteration are only needed if you want to manually control the paginated output. To disable autopagination, use -NoAutoIteration.

Parameters

Amazon.PowerShell.Cmdlets.SSM.AmazonSimpleSystemsManagementClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
Each element in the array is a structure containing a key-value pair.Windows ServerSupported keys for Windows Server managed node patches include the following:
  • PATCH_SETSample values: OS | APPLICATION
  • PRODUCTSample values: WindowsServer2012 | Office 2010 | MicrosoftDefenderAntivirus
  • PRODUCT_FAMILYSample values: Windows | Office
  • MSRC_SEVERITYSample values: ServicePacks | Important | Moderate
  • CLASSIFICATIONSample values: ServicePacks | SecurityUpdates | DefinitionUpdates
  • PATCH_IDSample values: KB123456 | KB4516046
LinuxWhen specifying filters for Linux patches, you must specify a key-pair for PRODUCT. For example, using the Command Line Interface (CLI), the following command fails:aws ssm describe-available-patches --filters Key=CVE_ID,Values=CVE-2018-3615However, the following command succeeds:aws ssm describe-available-patches --filters Key=PRODUCT,Values=AmazonLinux2018.03 Key=CVE_ID,Values=CVE-2018-3615Supported keys for Linux managed node patches include the following:
  • PRODUCTSample values: AmazonLinux2018.03 | AmazonLinux2.0
  • NAMESample values: kernel-headers | samba-python | php
  • SEVERITYSample values: Critical | Important | Medium | Low
  • EPOCHSample values: 0 | 1
  • VERSIONSample values: 78.6.1 | 4.10.16
  • RELEASESample values: 9.56.amzn1 | 1.amzn2
  • ARCHSample values: i686 | x86_64
  • REPOSITORYSample values: Core | Updates
  • ADVISORY_IDSample values: ALAS-2018-1058 | ALAS2-2021-1594
  • CVE_IDSample values: CVE-2018-3615 | CVE-2020-1472
  • BUGZILLA_IDSample values: 1463241
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesFilters
-MaxResult <Int32>
The maximum number of patches to return (per page).
Note: In AWSPowerShell and AWSPowerShell.NetCore this parameter is used to limit the total number of items returned by the cmdlet.
In AWS.Tools this parameter is simply passed to the service to specify how many items should be returned by each service call.
Pipe the output of this cmdlet into Select-Object -First to terminate retrieving data pages early and control the number of items returned.If a value for this parameter is not specified the cmdlet will use a default value of '50'.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesMaxItems, MaxResults
-NextToken <String>
The token for the next set of items to return. (You received this token from a previous call.)
Note: This parameter is only used if you are manually controlling output pagination of the service API call.
In order to manually control output pagination, use '-NextToken $null' for the first call and '-NextToken $AWSHistory.LastServiceResponse.NextToken' for subsequent calls.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NoAutoIteration <SwitchParameter>
By default the cmdlet will auto-iterate and retrieve all results to the pipeline by performing multiple service calls. If set, the cmdlet will retrieve only the next 'page' of results using the value of NextToken as the start point.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'Patches'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.SimpleSystemsManagement.Model.DescribeAvailablePatchesResponse). Specifying the name of a property of type Amazon.SimpleSystemsManagement.Model.DescribeAvailablePatchesResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (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)
AliasesAK
-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)
AliasesAWSProfilesLocation, 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)
AliasesStoredCredentials, 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)
AliasesRegionToCall
-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)
AliasesSK, 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)
AliasesST

Outputs

This cmdlet returns a collection of Amazon.SimpleSystemsManagement.Model.Patch objects. The service call response (type Amazon.SimpleSystemsManagement.Model.DescribeAvailablePatchesResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Examples

Example 1

$filter1 = @{Key="PRODUCT";Values=@("WindowsServer2012")}
$filter2 = @{Key="MSRC_SEVERITY";Values=@("Critical")}

Get-SSMAvailablePatch -Filter $filter1,$filter2

Classification : SecurityUpdates
ContentUrl : https://support.microsoft.com/en-us/kb/2727528
Description : A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control
over it. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to
restart your system.
Id : 1eb507be-2040-4eeb-803d-abc55700b715
KbNumber : KB2727528
Language : All
MsrcNumber : MS12-072
MsrcSeverity : Critical
Product : WindowsServer2012
ProductFamily : Windows
ReleaseDate : 11/13/2012 6:00:00 PM
Title : Security Update for Windows Server 2012 (KB2727528)
Vendor : Microsoft
...
This example gets all available patches for Windows Server 2012 that have a MSRC severity of Critical. The syntax used by this example requires PowerShell version 3 or later.

Example 2

$filter1 = New-Object Amazon.SimpleSystemsManagement.Model.PatchOrchestratorFilter
$filter1.Key = "PRODUCT"
$filter1.Values = "WindowsServer2012"
$filter2 = New-Object Amazon.SimpleSystemsManagement.Model.PatchOrchestratorFilter
$filter2.Key = "MSRC_SEVERITY"
$filter2.Values = "Critical"

Get-SSMAvailablePatch -Filter $filter1,$filter2
With PowerShell version 2, you must use New-Object to create each filter.

Example 3

Get-SSMAvailablePatch | Where-Object ReleaseDate -ge (Get-Date).AddDays(-20) | Where-Object Product -eq "WindowsServer2019" | Select-Object ReleaseDate, Product, Title

ReleaseDate Product Title
----------- ------- -----
4/9/2019 5:00:12 PM WindowsServer2019 2019-04 Security Update for Adobe Flash Player for Windows Server 2019 for x64-based Systems (KB4493478)
4/9/2019 5:00:06 PM WindowsServer2019 2019-04 Cumulative Update for Windows Server 2019 for x64-based Systems (KB4493509)
4/2/2019 5:00:06 PM WindowsServer2019 2019-03 Servicing Stack Update for Windows Server 2019 for x64-based Systems (KB4493510)
This example fetches all the updates which are released in last 20 days and applicable to products matching WindowsServer2019

Supported Version

AWS Tools for PowerShell: 2.x.y.z