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>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-Force <SwitchParameter>-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>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-Force <SwitchParameter>-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>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-Force <SwitchParameter>-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[]>-ConcurrentServiceRequest <Int32>-CalculateContentMD5Header <Boolean>-PartSize <FileSize>-Force <SwitchParameter>-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) |
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 |
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? | 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) |
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 test-files -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 test-files -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 test-files -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 test-files -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 test-files -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 test-files -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 test-files -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 test-files -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