Created
March 8, 2012 11:53
-
-
Save j3tm0t0/2000684 to your computer and use it in GitHub Desktop.
S3 Client .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -Path "C:\Program Files\AWS SDK for .NET\bin\AWSSDK.dll" | |
$secretKeyID="secretkeyid" | |
$secretAccessKeyID="accesskeyid" | |
$client=[Amazon.AWSClientFactory]::CreateAmazonS3Client($secretAccessKeyID,$secretKeyID) | |
$backup_directory="C:\target\" | |
foreach($file in Get-ChildItem -Path $backup_directory){ | |
$request = New-Object -TypeName Amazon.S3.Model.PutObjectRequest | |
[void]$request.WithFilePath($file.fullname) | |
[void]$request.WithBucketName("bucketname") | |
[void]$request.WithKey($file.name) | |
[void]$request.WithTimeout(3600000) | |
[void]$client.PutObject($request) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment