Skip to content

Instantly share code, notes, and snippets.

@rezarahimian
Created June 27, 2021 16:58
Show Gist options
  • Save rezarahimian/3bb39115fff8dee6ca9975c9edb309bd to your computer and use it in GitHub Desktop.
Save rezarahimian/3bb39115fff8dee6ca9975c9edb309bd to your computer and use it in GitHub Desktop.
$FilePath = 'C:\Temp\report_01.csv'
$OutputPath = 'C:\Temp\report_02.csv'
$Key = Split-Path -Path $FilePath -Leaf
$Url = 'https://s3.aws.com'
$BucketName = 'us-east-low-rw-team-a-shared'
$ProfileName = 'low_teams_shared'
Set-AWSCredential -AccessKey 'AWS_ACCESS_KEY' -SecretKey 'AWS_PASSWORD' -StoreAs $ProfileName
Set-AWSCredential -ProfileName $ProfileName
Write-S3Object -EndpointUrl $Url -BucketName $BucketName -Key $Key -File $FilePath
Read-S3Object -EndpointUrl $Url -BucketName $BucketName -Key $Key -File $OutputPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment