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.
DownloadFile (Default)
Read-S3Object-BucketName <String>-Key <String>-File <String>-Version <String>-ModifiedSinceDate <DateTime>-UnmodifiedSinceDate <DateTime>-UtcModifiedSinceDate <DateTime>-UtcUnmodifiedSinceDate <DateTime>-ServerSideEncryptionCustomerMethod <ServerSideEncryptionCustomerMethod>-ServerSideEncryptionCustomerProvidedKey <String>-ServerSideEncryptionCustomerProvidedKeyMD5 <String>-ChecksumMode <ChecksumMode>-ClientConfig <AmazonS3Config>-UseAccelerateEndpoint <SwitchParameter>-UseDualstackEndpoint <SwitchParameter>-ForcePathStyleAddressing <Boolean>DownloadFolder
Read-S3Object-BucketName <String>-KeyPrefix <String>-Folder <String>-DisableSlashCorrection <Boolean>-ModifiedSinceDate <DateTime>-UnmodifiedSinceDate <DateTime>-UtcModifiedSinceDate <DateTime>-UtcUnmodifiedSinceDate <DateTime>-ClientConfig <AmazonS3Config>-UseAccelerateEndpoint <SwitchParameter>-UseDualstackEndpoint <SwitchParameter>-ForcePathStyleAddressing <Boolean>FromS3ObjectToFileOrFolder
Read-S3Object-BucketName <String>-File <String>-Folder <String>-S3Object <S3Object>-ModifiedSinceDate <DateTime>-UnmodifiedSinceDate <DateTime>-UtcModifiedSinceDate <DateTime>-UtcUnmodifiedSinceDate <DateTime>-ServerSideEncryptionCustomerMethod <ServerSideEncryptionCustomerMethod>-ServerSideEncryptionCustomerProvidedKey <String>-ServerSideEncryptionCustomerProvidedKeyMD5 <String>-ChecksumMode <ChecksumMode>-ClientConfig <AmazonS3Config>-UseAccelerateEndpoint <SwitchParameter>-UseDualstackEndpoint <SwitchParameter>-ForcePathStyleAddressing <Boolean>
Required? | True |
Position? | 1 |
Accept pipeline input? | True (ByValue, ByPropertyName) |
ChecksumMode
and the object is KMS encrypted, you must have permission to the kms:Decrypt
action for the request to succeed. 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 (DownloadFile) |
Position? | 3 |
Accept pipeline input? | True (ByPropertyName) |
Required? | True (DownloadFolder) |
Position? | 3 |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Directory |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | 2 |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | 2 |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Prefix |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
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 (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? | False |
Position? | 4 |
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 |
Read-S3Object -BucketName test-files -Key sample.txt -File local-sample.txtThis command retrieves item "sample.txt" from bucket "test-files" and saves it to a file named "local-sample.txt" in the current location. The file "local-sample.txt" does not have to exist before this command is called.
Read-S3Object -BucketName test-files -KeyPrefix DIR -Folder Local-DIRThis command retrieves virtual directory "DIR" from bucket "test-files" and saves it to a folder named "Local-DIR" in the current location. The folder "Local-DIR" does not have to exist before this command is called.
Get-S3Bucket | ? { $_.BucketName -like '*config*' } | Get-S3Object | ? { $_.Key -like '*.json' } | Read-S3Object -Folder C:\ConfigObjectsDownloads all objects with keys ending in '.json' from buckets with 'config' in the bucket name to files in the specified folder. The object keys are used to set the filenames.
AWS Tools for PowerShell: 2.x.y.z