public override void ExecuteCmdlet()
        {
            DownloadVMFileOptions options = new DownloadVMFileOptions(this.BatchContext, this.PoolName, this.VMName,
                this.Name, this.InputObject, this.DestinationPath, this.DestinationStream, this.AdditionalBehaviors);

            BatchClient.DownloadVMFile(options);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Downloads a vm file using the specified options.
        /// </summary>
        /// <param name="options">The download options</param>
        public void DownloadVMFile(DownloadVMFileOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            ITaskFile vmFile = null;

            if (options.VMFile == null)
            {
                using (IPoolManager poolManager = options.Context.BatchOMClient.OpenPoolManager())
                {
                    vmFile = poolManager.GetVMFile(options.PoolName, options.VMName, options.VMFileName, options.AdditionalBehaviors);
                }
            }
            else
            {
                vmFile = options.VMFile.omObject;
            }

            DownloadITaskFile(vmFile, options.DestinationPath, "vm", options.Stream, options.AdditionalBehaviors);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Downloads a vm file using the specified options.
        /// </summary>
        /// <param name="options">The download options</param>
        public void DownloadVMFile(DownloadVMFileOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            ITaskFile vmFile = null;
            if (options.VMFile == null)
            {
                using (IPoolManager poolManager = options.Context.BatchOMClient.OpenPoolManager())
                {
                    vmFile = poolManager.GetVMFile(options.PoolName, options.VMName, options.VMFileName, options.AdditionalBehaviors);
                }
            }
            else
            {
                vmFile = options.VMFile.omObject;
            }

            DownloadITaskFile(vmFile, options.DestinationPath, "vm", options.Stream, options.AdditionalBehaviors);
        }