Skip to content

Upload file to AWS s3 bucket using PowerShell

Last updated on November 21, 2022

In this tutorial, we gonna upload files and folders to the AWS s3 bucket using PowerShell. First, you’ll need to install the general AWS.Tools.Installer package, for more information, follow the link.

Run the following command in PowerShell with admin privileges.

Install-Module -Name AWS.Tools.Installer

This post assumes that you have AccessKey, SecretKey for your AWS s3 bucket.

Set-AWSCredential `
                 -AccessKey "YOUR_ACCESS_KEY_ID" `
                 -SecretKey "YOUR_SECRET_ACCESS_KEY" `
                 -StoreAs default

After setting the AWS credential, let’s upload a file with the following command

 Write-S3Object -BucketName "YourBucketName" -Key "desiredFileNameInBucket.tar" -File "localFile.tar"

For more examples visit: https://docs.aws.amazon.com/powershell/latest/reference/items/Write-S3Object.html

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments