Trying to use PowerShell on Win2012 server, Cloudberry Explorer for Amazon S3 Pro 4.7 to connect to and push .json files from local server directories to AWS S3 buckets.
During run of powershell script I get error:
Select-CloudFolder : Redirect location is empty At C:\SrcFiles\AE_Time\s3_json_upload.ps1:20 char:22 + $destination = $s3 | Select-CloudFolder -path 'time-tracker-staging-import/accou ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Select-CloudFolder], Exception + FullyQualifiedErrorId : System.Exception,CloudBerryLab.Explorer.PSSnapIn.Commands.SelectCloudFolder
Copy-CloudItem : Cannot bind argument to parameter 'Destination' because it is null. At C:\SrcFiles\AE_Time\s3_json_upload.ps1:36 char:23 + $src | Copy-CloudItem $destination -filter "*.json" + ~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Copy-CloudItem], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,CloudBerryLab.Explorer.PSSnapIn.Commands.CopyCloudItem
I've looked at on the web and found several discussions about this, even the couple on StackOverflow, but they don't help. I'm not trying to autosync...
Getting the connection works ok, but no logs generated by CB Explorer, at least not at - C:\Users\svc_das\AppData\Local\CloudBerry S3 Explorer PRO\Logs
powershell script -
## enable the cloudberry ps-snapin and set path type
add-pssnapin cloudberrylab.explorer.pssnapin
Set-CloudOption -PathStyle path
## set variables with key and secret
$key = 'mykey'
$secret = 'mysecret'
## get connection
$s3 = Get-CloudS3Connection -Key $key -Secret $secret
## set AWS S3 bucket
$destination = $s3 | Select-CloudFolder -path 'time-tracker-staging-import/accounts'
## set local source directory -
$src = Get-CloudFilesystemConnection | Select- CloudFolder "C:\SrcFiles\AE_Time\json_files\accounts\"
## do the copy from local to S3 using a file filter
$src | Copy-CloudItem $destination -filter "*.json"
This is because you are missing path.
The following should facilitate your challenge.