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