/// <summary>
 /// set blob properties
 /// </summary>
 /// <param name="azureBlob">azure storage blob object</param>
 /// <param name="meta">blob properties hashtable</param>
 private void SetBlobProperties(AzureStorageBlob azureBlob, Hashtable properties)
 {
     SetBlobProperties(azureBlob.ICloudBlob, properties);
 }
        /// <summary>
        /// write blobs with storage context
        /// </summary>
        /// <param name="blobList">An enumerable collection of IListBlobItem</param>
        internal void WriteBlobsWithContext(IEnumerable<IListBlobItem> blobList)
        {
            if (null == blobList)
            {
                return;
            }

            foreach (IListBlobItem blobItem in blobList)
            {
                ICloudBlob blob = blobItem as ICloudBlob;

                if (blob == null)
                {
                    continue;
                }

                AzureStorageBlob azureBlob = new AzureStorageBlob(blob);
                WriteObjectWithStorageContext(azureBlob);
            }
        }
 /// <summary>
 /// set blob meta
 /// </summary>
 /// <param name="azureBlob">azure storage blob object</param>
 /// <param name="meta">meta data hashtable</param>
 private void SetBlobMeta(AzureStorageBlob azureBlob, Hashtable meta)
 {
     SetBlobMeta(azureBlob.ICloudBlob, meta);
 }
        public override void ExecuteCmdlet()
        {
            SetUpDestinationChannel();

            ICloudBlob destinationBlob = default(ICloudBlob);

            switch (ParameterSetName)
            {
                case NameParameterSet:
                    destinationBlob = StartCopyBlob(SrcContainer, SrcBlob, DestContainer, DestBlob);
                    break;

                case UriParameterSet:
                    destinationBlob = StartCopyBlob(AbsoluteUri, DestContainer, DestBlob, Context);
                    break;

                case SrcBlobParameterSet:
                    destinationBlob = StartCopyBlob(ICloudBlob, DestContainer, DestBlob);
                    break;

                case ContainerPipelineParameterSet:
                    destinationBlob = StartCopyBlob(CloudBlobContainer.Name, SrcBlob, DestContainer, DestBlob);
                    break;

                case DestBlobPipelineParameterSet:
                    destinationBlob = StartCopyBlob(ICloudBlob, DestICloudBlob);
                    break;
            }

            if (destinationBlob != null)
            {
                AccessCondition accessCondition = null;
                BlobRequestOptions options = null;
                //Make sure we use the dest channel
                destChannel.FetchBlobAttributes(destinationBlob, accessCondition, options, OperationContext);
                AzureStorageBlob azureBlob = new AzureStorageBlob(destinationBlob);
                //Make sure the dest context is piped out
                azureBlob.Context = DestContext;
                WriteObject(azureBlob);
            }
        }