Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Upload In-Line Text Content to Amazon S3 - AWS Tools for PowerShell

Upload In-Line Text Content to Amazon S3

The Write-S3Object cmdlet supports the ability to upload in-line text content to Amazon S3. Using the -Content parameter (alias -Text), you can specify text-based content that should be uploaded to Amazon S3 without needing to place it into a file first. The parameter accepts simple one-line strings as well as here strings that contain multiple lines.

PS > # Specifying content in-line, single line text: PS > write-s3object amzn-s3-demo-bucket -key myobject.txt -content "file content" PS > # Specifying content in-line, multi-line text: (note final newline needed to end in-line here-string) PS > write-s3object amzn-s3-demo-bucket -key myobject.txt -content @" >> line 1 >> line 2 >> line 3 >> "@ >> PS > # Specifying content from a variable: (note final newline needed to end in-line here-string) PS > $x = @" >> line 1 >> line 2 >> line 3 >> "@ >> PS > write-s3object amzn-s3-demo-bucket -key myobject.txt -content $x
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.