public override void ExecuteCmdlet() { DownloadRemoteDesktopProtocolFileOptions options = new DownloadRemoteDesktopProtocolFileOptions(this.BatchContext, this.PoolId, this.ComputeNodeId, this.ComputeNode, this.DestinationPath, this.DestinationStream, this.AdditionalBehaviors); this.BatchClient.DownloadRemoteDesktopProtocolFile(options); }
protected override void ProcessRecord() { DownloadRemoteDesktopProtocolFileOptions options = new DownloadRemoteDesktopProtocolFileOptions(this.BatchContext, this.PoolId, this.ComputeNodeId, this.ComputeNode, this.DestinationPath, this.DestinationStream, this.AdditionalBehaviors); this.BatchClient.DownloadRemoteDesktopProtocolFile(options); }
/// <summary> /// Downloads a Remote Desktop Protocol file using the specified options. /// </summary> /// <param name="options">The download options.</param> public void DownloadRemoteDesktopProtocolFile(DownloadRemoteDesktopProtocolFileOptions options) { if (options == null) { throw new ArgumentNullException("options"); } if (options.Stream != null) { // Don't dispose supplied Stream CopyRDPStream(options.Stream, options.Context.BatchOMClient, options.PoolId, options.ComputeNodeId, options.ComputeNode, options.AdditionalBehaviors); } else { string computeNodeId = options.ComputeNode == null ? options.ComputeNodeId : options.ComputeNode.Id; WriteVerbose(string.Format(Resources.DownloadingRDPFile, computeNodeId, options.DestinationPath)); using (FileStream fs = new FileStream(options.DestinationPath, FileMode.Create)) { CopyRDPStream(fs, options.Context.BatchOMClient, options.PoolId, options.ComputeNodeId, options.ComputeNode, options.AdditionalBehaviors); } } }
/// <summary> /// Downloads a Remote Desktop Protocol file using the specified options. /// </summary> /// <param name="options">The download options.</param> public void DownloadRemoteDesktopProtocolFile(DownloadRemoteDesktopProtocolFileOptions options) { if (options == null) { throw new ArgumentNullException("options"); } if (options.Stream != null) { // Don't dispose supplied Stream CopyRDPStream(options.Stream, options.Context.BatchOMClient, options.PoolId, options.ComputeNodeId, options.ComputeNode, options.AdditionalBehaviors); } else { string computeNodeId = options.ComputeNode == null ? options.ComputeNodeId : options.ComputeNode.Id; WriteVerbose(string.Format(Resources.GBRDP_Downloading, computeNodeId, options.DestinationPath)); using (FileStream fs = new FileStream(options.DestinationPath, FileMode.Create)) { CopyRDPStream(fs, options.Context.BatchOMClient, options.PoolId, options.ComputeNodeId, options.ComputeNode, options.AdditionalBehaviors); } } }