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 UpdateMaintenanceWindowTask API operation.

Syntax

Update-SSMMaintenanceWindowTask
-WindowTaskId <String>
-AlarmConfiguration_Alarm <Alarm[]>
-Lambda_ClientContext <String>
-CloudWatchOutputConfig_CloudWatchLogGroupName <String>
-CloudWatchOutputConfig_CloudWatchOutputEnabled <Boolean>
-RunCommand_Comment <String>
-CutoffBehavior <MaintenanceWindowTaskCutoffBehavior>
-Description <String>
-RunCommand_DocumentHash <String>
-RunCommand_DocumentHashType <DocumentHashType>
-Automation_DocumentVersion <String>
-RunCommand_DocumentVersion <String>
-AlarmConfiguration_IgnorePollAlarmFailure <Boolean>
-StepFunctions_Input <String>
-MaxConcurrency <String>
-MaxError <String>
-Name <String>
-StepFunctions_Name <String>
-NotificationConfig_NotificationArn <String>
-NotificationConfig_NotificationEvent <String[]>
-NotificationConfig_NotificationType <NotificationType>
-RunCommand_OutputS3BucketName <String>
-RunCommand_OutputS3KeyPrefix <String>
-Automation_Parameter <Hashtable>
-RunCommand_Parameter <Hashtable>
-Lambda_Payload <Byte[]>
-Priority <Int32>
-Lambda_Qualifier <String>
-Replace <Boolean>
-LoggingInfo_S3BucketName <String>
-LoggingInfo_S3KeyPrefix <String>
-LoggingInfo_S3Region <String>
-ServiceRoleArn <String>
-RunCommand_ServiceRoleArn <String>
-Target <Target[]>
-TaskArn <String>
-TaskParameter <Hashtable>
-RunCommand_TimeoutSecond <Int32>
-WindowId <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonSimpleSystemsManagementConfig>

Description

Modifies a task assigned to a maintenance window. You can't change the task type, but you can change the following values:
  • TaskARN. For example, you can change a RUN_COMMAND task from AWS-RunPowerShellScript to AWS-RunShellScript.
  • ServiceRoleArn
  • TaskInvocationParameters
  • Priority
  • MaxConcurrency
  • MaxErrors
One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide. If the value for a parameter in UpdateMaintenanceWindowTask is null, then the corresponding field isn't modified. If you set Replace to true, then all fields required by the RegisterTaskWithMaintenanceWindow operation are required for this request. Optional fields that aren't specified are set to null. When you update a maintenance window task that has options specified in TaskInvocationParameters, you must provide again all the TaskInvocationParameters values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified TaskInvocationParameters values for Comment, NotificationConfig, and OutputS3BucketName. If you update the maintenance window task and specify only a different OutputS3BucketName value, the values for Comment and NotificationConfig are removed.

Parameters

-AlarmConfiguration_Alarm <Alarm[]>
The name of the CloudWatch alarm specified in the configuration.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAlarmConfiguration_Alarms
-AlarmConfiguration_IgnorePollAlarmFailure <Boolean>
When this value is true, your automation or command continues to run in cases where we can’t retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Automation_DocumentVersion <String>
The version of an Automation runbook to use during task execution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_Automation_DocumentVersion
-Automation_Parameter <Hashtable>
The parameters for the AUTOMATION task.For information about specifying and updating task parameters, see RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask.LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.For AUTOMATION task types, Amazon Web Services Systems Manager ignores any values specified for these parameters.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_Automation_Parameters
Amazon.PowerShell.Cmdlets.SSM.AmazonSimpleSystemsManagementClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-CloudWatchOutputConfig_CloudWatchLogGroupName <String>
The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:aws/ssm/SystemsManagerDocumentName
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_CloudWatchOutputConfig_CloudWatchLogGroupName
-CloudWatchOutputConfig_CloudWatchOutputEnabled <Boolean>
Enables Systems Manager to send command output to CloudWatch Logs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_CloudWatchOutputConfig_CloudWatchOutputEnabled
Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
  • CONTINUE_TASK: When the cutoff time is reached, any tasks that are running continue. The default value.
  • CANCEL_TASK:
    • For Automation, Lambda, Step Functions tasks: When the cutoff time is reached, any task invocations that are already running continue, but no new task invocations are started.
    • For Run Command tasks: When the cutoff time is reached, the system sends a CancelCommand operation that attempts to cancel the command associated with the task. However, there is no guarantee that the command will be terminated and the underlying process stopped.
    The status for tasks that are not completed is TIMED_OUT.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Description <String>
The new task description to specify.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Lambda_ClientContext <String>
Pass client-specific information to the Lambda function that you are invoking. You can then process the client information in your Lambda function as you choose through the context variable.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_Lambda_ClientContext
-Lambda_Payload <Byte[]>
JSON to provide to your Lambda function as input.The cmdlet will automatically convert the supplied parameter of type string, string[], System.IO.FileInfo or System.IO.Stream to byte[] before supplying it to the service.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_Lambda_Payload
-Lambda_Qualifier <String>
(Optional) Specify an Lambda function version or alias name. If you specify a function version, the operation uses the qualified function Amazon Resource Name (ARN) to invoke a specific Lambda function. If you specify an alias name, the operation uses the alias ARN to invoke the Lambda function version to which the alias points.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_Lambda_Qualifier
-LoggingInfo_S3BucketName <String>
The name of an S3 bucket where execution logs are stored.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingInfo_S3KeyPrefix <String>
(Optional) The S3 bucket subfolder.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingInfo_S3Region <String>
The Amazon Web Services Region where the S3 bucket is located.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MaxConcurrency <String>
The new MaxConcurrency value you want to specify. MaxConcurrency is the number of targets that are allowed to run this task, in parallel.Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1. This value doesn't affect the running of your task.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MaxError <String>
The new MaxErrors value to specify. MaxErrors is the maximum number of errors that are allowed before the task stops being scheduled.Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1. This value doesn't affect the running of your task.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesMaxErrors
-Name <String>
The new task name to specify.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NotificationConfig_NotificationArn <String>
An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_NotificationConfig_NotificationArn
-NotificationConfig_NotificationEvent <String[]>
The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_NotificationConfig_NotificationEvents
-NotificationConfig_NotificationType <NotificationType>
The type of notification.
  • Command: Receive notification when the status of a command changes.
  • Invocation: For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_NotificationConfig_NotificationType
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the WindowTaskId parameter. The -PassThru parameter is deprecated, use -Select '^WindowTaskId' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Priority <Int32>
The new task priority to specify. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Replace <Boolean>
If True, then all fields that are required by the RegisterTaskWithMaintenanceWindow operation are also required for this API request. Optional fields that aren't specified are set to null.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-RunCommand_Comment <String>
Information about the commands to run.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_Comment
-RunCommand_DocumentHash <String>
The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_DocumentHash
-RunCommand_DocumentHashType <DocumentHashType>
SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_DocumentHashType
-RunCommand_DocumentVersion <String>
The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:--document-version "\$DEFAULT"--document-version "\$LATEST"--document-version "3"
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_DocumentVersion
-RunCommand_OutputS3BucketName <String>
The name of the Amazon Simple Storage Service (Amazon S3) bucket.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_OutputS3BucketName
-RunCommand_OutputS3KeyPrefix <String>
The S3 bucket subfolder.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_OutputS3KeyPrefix
-RunCommand_Parameter <Hashtable>
The parameters for the RUN_COMMAND task execution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_Parameters
-RunCommand_ServiceRoleArn <String>
The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_ServiceRoleArn
-RunCommand_TimeoutSecond <Int32>
If this time is reached and the command hasn't already started running, it doesn't run.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_RunCommand_TimeoutSeconds
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is '*'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.SimpleSystemsManagement.Model.UpdateMaintenanceWindowTaskResponse). Specifying the name of a property of type Amazon.SimpleSystemsManagement.Model.UpdateMaintenanceWindowTaskResponse 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)
-ServiceRoleArn <String>
The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run RegisterTaskWithMaintenanceWindow.However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see Setting up maintenance windows in the in the Amazon Web Services Systems Manager User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-StepFunctions_Input <String>
The inputs for the STEP_FUNCTIONS task.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_StepFunctions_Input
-StepFunctions_Name <String>
The name of the STEP_FUNCTIONS task.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskInvocationParameters_StepFunctions_Name
-Target <Target[]>
The targets (either managed nodes or tags) to modify. Managed nodes are specified using the format Key=instanceids,Values=instanceID_1,instanceID_2. Tags are specified using the format Key=tag_name,Values=tag_value. One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTargets
-TaskArn <String>
The task ARN to modify.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-TaskParameter <Hashtable>
The parameters to modify.TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.The map has the following format:Key: string, between 1 and 255 charactersValue: an array of strings, each string is between 1 and 255 characters
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTaskParameters
-WindowId <String>
The maintenance window ID that contains the task to modify.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-WindowTaskId <String>
The task ID to modify.
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)
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 an Amazon.SimpleSystemsManagement.Model.UpdateMaintenanceWindowTaskResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

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