public override void ExecuteCmdlet() { DownloadNodeFileOptions options = new DownloadNodeFileOptions(this.BatchContext, this.JobId, this.TaskId, this.PoolId, this.ComputeNodeId, this.Name, this.InputObject, this.DestinationPath, this.DestinationStream, this.AdditionalBehaviors); BatchClient.DownloadNodeFile(options); }
/// <summary> /// Downloads a node file using the specified options. /// </summary> /// <param name="options">The download options.</param> public void DownloadNodeFile(DownloadNodeFileOptions options) { if (options == null) { throw new ArgumentNullException("options"); } NodeFile nodeFile = null; switch (options.NodeFileType) { case PSNodeFileType.Task: { JobOperations jobOperations = options.Context.BatchOMClient.JobOperations; nodeFile = jobOperations.GetNodeFile(options.JobId, options.TaskId, options.NodeFileName, options.AdditionalBehaviors); break; } case PSNodeFileType.ComputeNode: { PoolOperations poolOperations = options.Context.BatchOMClient.PoolOperations; nodeFile = poolOperations.GetNodeFile(options.PoolId, options.ComputeNodeId, options.NodeFileName, options.AdditionalBehaviors); break; } case PSNodeFileType.PSNodeFileInstance: { nodeFile = options.NodeFile.omObject; break; } default: { throw new ArgumentException(Resources.NoNodeFile); } } DownloadNodeFileByInstance(nodeFile, options.DestinationPath, options.Stream, options.AdditionalBehaviors); }
protected override void ProcessRecord() { DownloadNodeFileOptions options = new DownloadNodeFileOptions(this.BatchContext, this.JobId, this.TaskId, this.PoolId, this.ComputeNodeId, this.Name, this.InputObject, this.DestinationPath, this.DestinationStream, this.AdditionalBehaviors); BatchClient.DownloadNodeFile(options); }