CloudBuddy Powershell


    What is Windows PowerShell?

  • Windows PowerShell is a Windows command-line shell designed especially for system administrators. This includes an interactive prompt and a scripting environment that can be used independently or in combination.
  • Windows PowerShell is built on top of the .NET Framework common language runtime (CLR) and the .NET Framework, and accepts and returns .NET Framework objects.
  • Windows PowerShell introduces the concept of a cmdlet (pronounced "command-let"), a simple and single-function command-line tool built into the shell.
  • Prerequisites

  • The following are the prerequisites to run PowerShell for CloudBuddy.

  • Steps to start using CloudBuddy Powershell

  • CloudBuddy PowerShell can be downloaded here.
    1. 1. Run the CloudBuddyPowerShell.exe.
    2. 2. To verify whether CloudBuddyPowerShell has been installed and registered properly by using the instructions given below :

      • Open Windows Powershell :
      • Start -> All Programs -> Windows PowerShell 1.0 -> Windows PowerShell, or
      • Start -> Run -> powershell
    3. 3. Type Get-PSSnapin : Registered
    4.      If the following is not listed, then try re-installing the CloudBuddyPowerShellUtility as in
      1.   Name : CloudBuddyPowerShell
      2.   PSVersion : 1.0
      3.   Description : This is a PowerShell Snap-in for CloudBuddy.
      4.   If you see the above then you are ready to use CloudBuddy PowerShell extension.
    5. 4. Install the CloudBuddyPowerShell utility manually (In case of any issues during step 1 &2):
      1. Open the Windows Command Prompt:
      2. Start -> Run -> cmd, or
      3. Start -> All Programs -> Accessories -> Command Prompt
      4. Traverse into CloudBuddy Installation Path, say "C:\Program Files\CloudBuddy\Client" and make sure that CloudBuddyPowerShell.dll is present.
      5. Type installutil CloudBuddyPowerShell.dll *
      6. Continue Step 2 & Step 3
      7. * - Incase the "installutil is not recognized as an internal or external command, operable program or batch file" error appears, see Windows Help on setting environment variables and append the full path of installutil.exe (which is a part of the .Net Framework re-distributable package) to the Path variable.

    List of CloudBuddy PowerShell Cmdlets

  • (M) : Denotes Mandatory
  • (O) : Denotes Optional
  • NAME CBList:Accounts
    DESCRIPTION Lists all the accounts configured in CloudBuddy Personal
    PARAMETERS None
    EXAMPLES CBList:Accounts
    NAME CBList:Buckets
    DESCRIPTION Lists all the buckets available in S3
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    EXAMPLES CBList:Buckets :AccountName mys3account
    NAME CBList:Files
    DESCRIPTION Lists all the files and Folders available in the bucket. By specifying : FolderPath retrieves files from a specific folder under the bucket
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFolder (O) : Existing folder in your bucket
    EXAMPLES E1. CBList : Files :AccountName mys3account :BucketName mybucket :RemoteFolder foldername
    E2. CBList:Files AccountName mys3account :BucketName mybucket
    NAME CBCreate:Bucket
    DESCRIPTION Creates a bucket in the specified S3 Account configured in CloudBuddy Personal
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : New bucket to be created
    BucketLocation(M) : Either US or EU
    EXAMPLES CBCreate:Bucket :mys3account : BucketName mybucket :BucketLocation US
    NAME CBCreate:Folder
    DESCRIPTION Creates a folder in the specified bucket
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    FolderName (M) : Folder to be created
    EXAMPLES CBCreate:Folder :AccountName mys3Account :BucketName mybucket :FolderName folder
    NAME CBUpload : File
    DESCRIPTION Uploads the specified local file to the given folder/bucket. This command submits the upload task to the CloudBuddy Personal. You can check the status of the upload in ViewActivity Screen.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFolder (M) : Existing folder in your bucket
    LocalFile (M) : Specify the local file to be uploaded
    EXAMPLES E1. CBUpload:File :AccountName mys3account :BucketName mybucket :RemoteFolder folderpath :LocalFile filepath
    Or
    E2. CBUpload:File :AccountName mys3account :BucketName mybucket :RemoteFolder folderpath :LocalFile filepath :DomainName mydomainname :UserName username :Password password :IsEncryptionEnabled yes
    NAME CBUpload:Folder
    DESCRIPTION Uploads the specified local folder to the given remote folder/bucket. This command submits the upload task to the CloudBuddy Personal. You can check the status of the upload in the ViewActivity Screen.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFolder (M) : Existing folder in your bucket
    LocalFolder (M) : Specify the local folder to be uploaded
    EXAMPLES E1. CBUpload:Folder :AccountName mys3account :BucketName mybucket :RemoteFolder foldername :LocalFolder foldername
    NAME CBDownload:File
    DESCRIPTION Uploads the specified local folder to the given remote folder/bucket. This command submits the upload task to the CloudBuddy Personal. You can check the status of the upload in the ViewActivity Screen.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFolder (M) : Existing folder in your bucket
    LocalFolder (M) : Specify the local folder to be uploaded
    EXAMPLES E1. CBUpload:Folder :AccountName mys3account :BucketName mybucket :RemoteFolder foldername :LocalFolder foldername
    NAME CBDownload:File
    DESCRIPTION Downloads the specified remote file to the given local folder. This command submits the download task to the CloudBuddy Personal. You can check the status of the download in the ViewActivity Screen.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFile (M) : Existing file path under the above specified bucket
    LocalFolder (M) : Specify the local folder to be downloaded
    EXAMPLES CBDownload:File :AccountName mys3account :BucketName mybucket :RemoteFile filename :LocalFolder foldername
    NAME CBDownload:Folder
    DESCRIPTION Downloads the specified remote folder to the given local folder. This command submits the download task to the CloudBuddy Personal. You can check the status of the download in the ViewActivity Screen.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFolder (M) : Existing folder path under the above specified bucket
    LocalFolder (M) : Specify the local folder to be downloaded
    EXAMPLES CBDownload:Folder :AccountName mys3account :BucketName mybucket :RemoteFolder foldername :LocalFolder foldername
    NAME CBCopy:File
    DESCRIPTION Copy a file that exist in your remote folder to an another remote folder within an account. Interrupting the process may lead to data inconsistency.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    SourceBucketName (M) : Existing bucket in your S3 Account
    DestinationBucketName (M) : Existing bucket in your S3 Account.
    RemoteFile (M) : Specify the remote source file path, to be copied
    RemoteFolder (M) : Specify the remote destination file path, to be placed
    EXAMPLES CBCopy:File :AccountName mys3account :SourceBucketName mybucket :DestinationBucketName mybucket :RemoteFile filename :RemoteFolder foldername
    NAME CBCopy:Folder
    DESCRIPTION Copy a remote folder under another remote folder within the same account. Interrupting the process may lead to data inconsistency.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    SourceBucketName (M) : Existing bucket in your S3 Account
    DestinationBucketName (M) : Existing bucket in your S3 Account.
    SourceRemoteFolder (M) : Specify the remote source folder path, to be copied
    DestinationRemoteFolder(M) : Specify the remote destination folder path, to be placed
    EXAMPLES CBCopy:Folder :AccountName mys3account :SourceBucketName mybucket :DestinationBucketName mybucket :SourceRemoteFolder filename :DestinationRemoteFolder foldername
    NAME CBMove:File
    DESCRIPTION Move a remote file to another remote folder within the same account. Interrupting the process may lead to data inconsistency.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    SourceBucketName (M) : Existing bucket in your S3 Account
    DestinationBucketName (M) : Existing bucket in your S3 Account.
    RemoteFile (M) : Specify the remote source file path, to be copied
    RemoteFolder (M) : Specify the remote destination folder path, to be placed
    EXAMPLES CBMove:File :AccountName mys3account :SourceBucketName mybucketname :DestinationBucketName mybucketname :RemoteFile filename :RemoteFolder foldername
    NAME CBMove:Folder
    DESCRIPTION Move a remote folder to another remote bucket or folder within the same account. Interrupting the process may lead to data inconsistency.
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    SourceBucketName (M) : Existing bucket in your S3 Account
    DestinationBucketName (M) : Existing bucket in your S3 Account.
    SourceRemoteFolder(M) : Specify the remote source folder path, to be copied
    DestinationRemoteFolder(M) : Specify the remote destination folder path, to be placed
    EXAMPLES CBMove:Folder :AccountName mys3account :SourceBucketName mybucket :DestinationBucketName mybucket :SourceRemoteFolder filename :DestinationRemoteFolder foldername
    NAME CBRename:File
    DESCRIPTION Renaming a specific file name that is already uploaded into S3 account
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFile(M) : Specify the remote file path, to be renamed
    NewFileName(M) : New File name to be named
    EXAMPLES CBRename:File :AccountName mys3account : BucketName mybucket : RemoteFile filename : NewFileName fildename
    NAME CBRename:Folder
    DESCRIPTION Renaming a folder name that is already uploaded into S3 account
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFolder(M) : Specify the remote folder path to be renamed
    NewFolderName (M) : New Folder name to be named
    EXAMPLES CBRename:Folder :AccountName mys3account : BucketName mybucket : RemoteFolder foldername :NewFolderName foldername
    NAME CBDelete:Bucket
    DESCRIPTION Deletes the Bucket under specified S3 account
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Bucket to be deleted
    EXAMPLES CBDelete:Bucket :AccountName mys3account :BucketName mybucket
    NAME CBDelete:Folder
    DESCRIPTION Deletes the Folder specified S3 account and folder
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFolder(M) : Folder to be deleted
    EXAMPLES CBDelete:Folder :AccountName mys3account :BucketName mybucket :RemoteFolder foldername
    NAME CBDelete:File
    DESCRIPTION Deletes the files under the specified folder
    PARAMETERS AccountName (M) : Configured with CloudBuddy Personal
    BucketName (M) : Existing bucket in your S3 Account
    RemoteFile(M) : File to be deleted
    EXAMPLES CBDelete:File :AccountName mys3account :BucketName mybucket :RemoteFile filename

    How to use Cmdlet Parameters

    • 1. Care should be taken to enclose parameters that contain embedded spaces within "" when they are keyed:in at the command line.      However, if the parameters are keyed:in only when prompted for, then "" should not be used.
    • 2. While specifying any path parameter related to S3, the path should include the full path of the object excluding the bucket name.
    • 3. Any parameter related to S3, which includes AccountName, BucketName and Path values are case:sensitive.
    • 4. For parameters of type "bool", the following are valid inputs :
      1. a. Yes
      2. b. Y
      3. c. True
      4. d. T
      5. e. No
      6. f. N
      7. g. False
      8. h. F
    • 5. The above parameters are not case sensitive.
    • 6. In case of doing operations at the bucket level, the remote path needs to be specified as " / ".