Menu
AWS Tools for Windows PowerShell
User Guide

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.

Copy
# Specifying content in-line, single line text: write-s3object mybucket -key myobject.txt -content "file content" # Specifying content in-line, multi-line text: (note final newline needed to end in-line here-string) write-s3object mybucket -key myobject.txt -content @" >> line 1 >> line 2 >> line 3 >> "@ >> # Specifying content from a variable: (note final newline needed to end in-line here-string) $x = @" >> line 1 >> line 2 >> line 3 >> "@ >> write-s3object mybucket -key myobject.txt -content $x