CloudBerry Explorer PowerShell Snap-in

CloudBerry Explorer offers PowerShell extension to manage file operations across Amazon Simple Storage Service (Amazon S3), Amazon Glacier and file system. Windows PowerShell is a command line shell that helps IT professionals to easily control system and accelerate automation. It includes a number of system administration utilities, improved navigation of common management data such as the registry, certificate store, or WMI, etc.

What is good about PowerShell and CloudBerry Explorer Snap-in?

PowerShell Snap-in allows using the majority of Amazon S3 functionality. You can combine CloudBerry Explorer commands with PowerShell commands. PowerShell is designed to operate with .Net objects, so you are not limited with command syntax. You can write complicated scripts with loops and conditions. You can schedule periodical tasks like data backup or cleanup.

Note: for the operations such as "local to S3" and "S3 to local" you need to specify only one key: -DstSSEKey for upload; -SrcSSEKey for download. For the operations such as “S3 to S3” or rename on S3 you can use two keys and they can be different – it allows to modify SSE-C key for already encrypted files.

You can set connection to your Amazon Glacier account, set connection options, upload files to Amazon Glacier and set filters for files to upload. Also you can restore data from Amazon Glacier using PowerShell commands. Check out the Examples below:

ADVANCED OPTIONS (PRO ONLY)Set-CloudOption -ThreadCount <number> Defines count of threads for multithreading uploading/downloading.Set-CloudOption -UseCompression <value> Defines whether to use compression or not.Set-CloudOption -UseChunks <value> -ChunkSizeKB <sizeinKB> Defines a size of chunk in KB; files larger than a chunk will be divided into chunks.

Values: 1 or 0

If you want to download a file that was divided into chunks on S3 storage you should enable "chunk transparency" mode before downloading the file in order to download it as a single file:Set-CloudOption -ChunkTransparency 1 When you copy or move files to S3 these files can inherit ACL from parent object: bucket or folder.Set-CloudOption -PermissionsInheritance <value>Values: "donotinherit", "onlyforcloudfront", "inheritall"

The file "result.xls" will automatically have the same ACL as "myBucket/weeklyreport".Set-CloudOption -KeepExistingHeaders Keep existing HTTP headers when replacing files on S3.Set-CloudOption -DoNotChangePermissionsForExisting <value> Keep ACL for files when replacing them on S3.

Removes bucket. Before bucket will be removed all contents must be removed. It can take long time, progress is displayed.

-Connection <CloudS3Connection> S3 Connection

-Name <String> Bucket name

-Force Suppress warning messages

-Bucket <CloudFolder> Bucket object

Example:$s3 | Remove-CloudBucket mytestbucketGet-CloudItemACL - Returns all access control entry for specified item. It can be S3 bucket, folder or file. You can get item using Select-CloudFolder or Get-CloudItems commands.

-Item <CloudItem> Cloud item, it can be bucket, s3 folder or s3 file.

Example:$fld = $s3 | Select-CloudFolder mytestbucket/documents $fld | Get-CloudItemACLAdd-CloudItemPermission - Grants permission to user or group. If user is not in the ACL, user entry will be added.

-Item <CloudItem> Cloud item, it can be bucket, s3 folder or s3 file.

-UserName <String> Username or group

-Write Grant write permission

-WriteACP Grant write ACP permission

-Read Grant read permission

-ReadACP Grant read ACP permission

-FullControl Grant full control permission. This means that all other permission will be granted.

Installation

Powershell Snap-In must be registered and added to console.

System Requirements

.NET Framework 4.0 (full version) Windows Management Framework 3.0

Registering Snap-In

If the PowerShell is installed prior to installation of CloudBerry Explorer, you do not need to install Snap-in. Otherwise, run the following command in the CloudBerry Explorer installation folder (c:\Program Files\CloudBerryLab\CloudBerry Explorer for Amazon S3): C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe CloudBerryLab.Explorer.PSSnapIn.dll

Note: For x64 the command must be like : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe "C:\Program Files (x86)\CloudBerryLab\CloudBerry Explorer for Amazon S3\CloudBerryLab.Explorer.PSSnapIn.dll"

You can verify that the CloudBerry Explorer Snap-in is registered. Run the following command:

Get-PSsnapin -Registered

PowerShell displays registered Snap-Ins. Check that CloudBerryLab.Explorer.PSSnapIn is in the list.

Adding Snap-In to console

You can check that CloudBerry Explorer Snap-in is registered by running command above. To add Snap-In to console run the following command:

Add-PSSnapin CloudBerryLab.Explorer.PSSnapIn

Now new command will be available.

Exporting console configuration

You should run Add-PSSnapin command anytime you start PowerShell or you can save configuration using the following.

Run PowerShell.

Add Snap-In to console.

Run the command: Export-Console CloudBerryExplorerConfig

CloudBerryExplorerConfig is the name of a console file to save configuration. To start the PowerShell from a saved configuration run the command: C:\Program Files\Command Shell> PS -PSConsoleFile CloudBerryExplorerConfig.psc1. CloudBerry Explorer commands will be available.