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.
UploadSingleFile (Default)
Write-S3Object-BucketName <String>-Key <String>-File <String>-CannedACLName <S3CannedACL>-PublicReadOnly <SwitchParameter>-PublicReadWrite <SwitchParameter>-ContentType <String>-StorageClass <S3StorageClass>-StandardStorage <SwitchParameter>-ReducedRedundancyStorage <SwitchParameter>-ServerSideEncryption <ServerSideEncryptionMethod>-ServerSideEncryptionKeyManagementServiceKeyId <String>-ServerSideEncryptionCustomerMethod <ServerSideEncryptionCustomerMethod>-ServerSideEncryptionCustomerProvidedKey <String>-ServerSideEncryptionCustomerProvidedKeyMD5 <String>-Metadata <Hashtable>-HeaderCollection <Hashtable>-TagSet <Tag[]>-ChecksumAlgorithm <ChecksumAlgorithm>-RequestPayer <RequestPayer>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-IfNoneMatch <String>-Force <SwitchParameter>-ClientConfig <AmazonS3Config>-UseAccelerateEndpoint <SwitchParameter>-UseDualstackEndpoint <SwitchParameter>-ForcePathStyleAddressing <Boolean>UploadFromContent
Write-S3Object-BucketName <String>-Key <String>-Content <String>-CannedACLName <S3CannedACL>-PublicReadOnly <SwitchParameter>-PublicReadWrite <SwitchParameter>-ContentType <String>-StorageClass <S3StorageClass>-StandardStorage <SwitchParameter>-ReducedRedundancyStorage <SwitchParameter>-ServerSideEncryption <ServerSideEncryptionMethod>-ServerSideEncryptionKeyManagementServiceKeyId <String>-ServerSideEncryptionCustomerMethod <ServerSideEncryptionCustomerMethod>-ServerSideEncryptionCustomerProvidedKey <String>-ServerSideEncryptionCustomerProvidedKeyMD5 <String>-Metadata <Hashtable>-HeaderCollection <Hashtable>-TagSet <Tag[]>-ChecksumAlgorithm <ChecksumAlgorithm>-RequestPayer <RequestPayer>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-IfNoneMatch <String>-Force <SwitchParameter>-ClientConfig <AmazonS3Config>-UseAccelerateEndpoint <SwitchParameter>-UseDualstackEndpoint <SwitchParameter>-ForcePathStyleAddressing <Boolean>UploadFromStream
Write-S3Object-BucketName <String>-Key <String>-Stream <Object>-CannedACLName <S3CannedACL>-PublicReadOnly <SwitchParameter>-PublicReadWrite <SwitchParameter>-ContentType <String>-StorageClass <S3StorageClass>-StandardStorage <SwitchParameter>-ReducedRedundancyStorage <SwitchParameter>-ServerSideEncryption <ServerSideEncryptionMethod>-ServerSideEncryptionKeyManagementServiceKeyId <String>-ServerSideEncryptionCustomerMethod <ServerSideEncryptionCustomerMethod>-ServerSideEncryptionCustomerProvidedKey <String>-ServerSideEncryptionCustomerProvidedKeyMD5 <String>-Metadata <Hashtable>-HeaderCollection <Hashtable>-TagSet <Tag[]>-ChecksumAlgorithm <ChecksumAlgorithm>-RequestPayer <RequestPayer>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-IfNoneMatch <String>-Force <SwitchParameter>-ClientConfig <AmazonS3Config>-UseAccelerateEndpoint <SwitchParameter>-UseDualstackEndpoint <SwitchParameter>-ForcePathStyleAddressing <Boolean>UploadFolder
Write-S3Object-BucketName <String>-KeyPrefix <String>-Folder <String>-Recurse <SwitchParameter>-SearchPattern <String>-CannedACLName <S3CannedACL>-PublicReadOnly <SwitchParameter>-PublicReadWrite <SwitchParameter>-ContentType <String>-StorageClass <S3StorageClass>-StandardStorage <SwitchParameter>-ReducedRedundancyStorage <SwitchParameter>-ServerSideEncryption <ServerSideEncryptionMethod>-ServerSideEncryptionKeyManagementServiceKeyId <String>-ServerSideEncryptionCustomerMethod <ServerSideEncryptionCustomerMethod>-ServerSideEncryptionCustomerProvidedKey <String>-ServerSideEncryptionCustomerProvidedKeyMD5 <String>-Metadata <Hashtable>-HeaderCollection <Hashtable>-TagSet <Tag[]>-RequestPayer <RequestPayer>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-IfNoneMatch <String>-Force <SwitchParameter>-ClientConfig <AmazonS3Config>-UseAccelerateEndpoint <SwitchParameter>-UseDualstackEndpoint <SwitchParameter>-ForcePathStyleAddressing <Boolean>
Required? | True |
Position? | 1 |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ConcurrentServiceRequests |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Text |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | 3 |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | 3 |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Directory |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Headers |
412 Precondition Failed
error.If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict
response. On a 409 failure you should re-initiate the multipart upload with CreateMultipartUpload
and re-upload each part.Expects the '*' (asterisk) character.For more information about conditional requests, see RFC 7232, or Conditional requests in the Amazon S3 User Guide. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True (UploadFromContent, UploadFromStream) |
Position? | 2 |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | 2 |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Prefix |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | 4 |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | 5 |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Pattern |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
x-amz-server-side-encryption
has a valid value of aws:kms
, this header specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms
, but do not provide x-amz-server-side-encryption-aws-kms-key-id
, Amazon S3 uses the Amazon Web Services managed key to protect the data. If the KMS key does not exist in the same account issuing the command, you must use the full ARN and not just the ID. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
Write-S3Object -BucketName amzn-s3-demo-bucket -Key "sample.txt" -File .\local-sample.txtThis command uploads the single file "local-sample.txt" to Amazon S3, creating an object with key "sample.txt" in bucket "test-files".
Write-S3Object -BucketName amzn-s3-demo-bucket -File .\sample.txtThis command uploads the single file "sample.txt" to Amazon S3, creating an object with key "sample.txt" in bucket "test-files". If the -Key parameter is not supplied, the filename is used as the S3 object key.
Write-S3Object -BucketName amzn-s3-demo-bucket -Key "prefix/to/sample.txt" -File .\local-sample.txtThis command uploads the single file "local-sample.txt" to Amazon S3, creating an object with key "prefix/to/sample.txt" in bucket "test-files".
Write-S3Object -BucketName amzn-s3-demo-bucket -Folder .\Scripts -KeyPrefix SampleScripts\This command uploads all files in the subdirectory "Scripts" to the bucket "test-files" and applies the common key prefix "SampleScripts" to each object. Each uploaded file will have a key of "SampleScripts/filename" where 'filename' varies.
Write-S3Object -BucketName amzn-s3-demo-bucket -Folder .\Scripts -KeyPrefix SampleScripts\ -SearchPattern *.ps1This command uploads all *.ps1 files in the local director "Scripts" to bucket "test-files" and applies the common key prefix "SampleScripts" to each object. Each uploaded file will have a key of "SampleScripts/filename.ps1" where 'filename' varies.
Write-S3Object -BucketName amzn-s3-demo-bucket -Key "sample.txt" -Content "object contents"This command creates a new S3 object containing the specified content string with key 'sample.txt'.
Write-S3Object -BucketName amzn-s3-demo-bucket -File "sample.txt" -TagSet @{Key="key1";Value="value1"},@{Key="key2";Value="value2"}This command uploads the specified file (the filename is used as the key) and applies the specified tags to the new object.
Write-S3Object -BucketName amzn-s3-demo-bucket -Folder . -KeyPrefix "TaggedFiles" -Recurse -TagSet @{Key="key1";Value="value1"},@{Key="key2";Value="value2"}This command recursively uploads the specified folder and applies the specified tags to all the new objects.
AWS Tools for PowerShell: 2.x.y.z