How to avoid output being truncated when running AWS SSM command? I've got the following AWS CLI commands to run the PowerShell's Invoke-WebRequest command:

instanceId=i-0xyz # Change this.
cmdId=$(aws ssm send-command --instance-ids "$instanceId" --document-name "AWS-RunPowerShellScript" --query "Command.CommandId" --output text --parameters commands='"While ($i -le 10) {Invoke-WebRequest -UseBasicParsing -Uri http://example.com; $i += 1}"')
sleep 1
aws ssm list-command-invocations --command-id "$cmdId" --details --query "CommandInvocations[*].CommandPlugins[*].Output[]" --output text


However, the output is truncated:

...
StatusCode        : 200
StatusDescription : OK
Content           : &lt;!doctype html&gt;
                    &lt;html&gt;
                    &lt;head&gt;
                        &lt;title&gt;Example Domain&lt;/title&gt;

                        &lt;meta charset="utf-8" /&gt;
                        &lt;meta http-equiv="Content-type" content="text/html; 
                    charset=utf-8" /&gt;
                        &lt;meta name="viewport" conten...
------------------Output truncated-------------------


How I can run aws ssm list-command-invocations command, so the output won't be truncated?
According to this ssm tutorial, SSM send-command output is truncated at 2500 characters.  To work around that, you must send your output to an S3 bucket using the --output-s3-bucket-name parameter.