Skip to content

Instantly share code, notes, and snippets.

View speaktech-account's full-sized avatar

speaktech speaktech-account

View GitHub Profile
@speaktech-account
speaktech-account / Archive-FileToS3.ps1
Last active December 11, 2017 12:49
Archives local files to S3bucket with verifying integrity. Powershell
# Archive-FileToS3 archives local files which is older than specified days in a path to S3bucket with verifying integrity of uploaded S3objects.
# The verification method is to check if an eTag of S3object matches an eTag value calculated from a local file.
# Get-S3ETagHash calculates an eTag for a local file that should match the S3 eTag of the uploaded file.
# Credit goes to Sean Bamforth (https://gist.github.com/seanbamforth/9388507) and chrisdarth(https://gist.github.com/chrisdarth/02d030b31727d70d2c63)
function Archive-FileToS3 {
[cmdletbinding()]
Param (
[Parameter(Mandatory=$true)]