$privateKeyFilePath="D:\amazon\privateKey.txt"; $secrectPrivateKeyFilePath="D:\amazon\secretPrivateKey.txt"; $secretKeyID=(cat $privateKeyFilePath); $secretAccessKeyID=(cat $secrectPrivateKeyFilePath); $bucket_name="rendermax"; function s3_putObject([string] $path, [string]$objName) { # first we need to zip it. make a temp file name $tempZipName=join-path -path (get-location) -childpath "$ObjName.zip"; . .\pszip.ps1 if ((zip "$path" "$tempZipName") -eq $true) { s3cmd put --acl-public $tempZipName s3://$bucket_name/$objName return $true; } return $false; } function S3_GetObject([string] $path, [string] $objName) { # make a temp file name $tempZipName=join-path -path (get-location) -childpath "$ObjName.zip"; if (test-path -path $tempZipName) { remove-item -path $tempZipName -force; } s3cmd get s3://$bucket_name/$objName $tempZipName # now we need to unzip it . .\pszip.ps1 #echo "path=$path, tempZipName=$tempZipName" if ((unzip $path $tempZipName) -eq $true) { Remove-Item -Path $tempZipName -force; return $true; } return $false; }