internal CustomAsyncCommandRuntime(PSCmdlet cmdlet, CancellationToken cancellationToken) { _originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; _originalThread = Thread.CurrentThread; CancellationToken = cancellationToken; _cmdlet = cmdlet; cmdlet.CommandRuntime = this; }
internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) { this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; this.originalThread = System.Threading.Thread.CurrentThread; this.cancellationToken = cancellationToken; this.cmdlet = cmdlet; cmdlet.CommandRuntime = this; }
internal void UseCommandRuntime(ICommandRuntime2 commandRuntime) { OnWriteVerbose = commandRuntime.WriteVerbose; OnWriteWarning = commandRuntime.WriteWarning; OnWriteError = commandRuntime.WriteError; OnWriteInformation = commandRuntime.WriteInformation; OnWriteDebug = commandRuntime.WriteDebug; OnWriteObject = commandRuntime.WriteObject; }
internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) { this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; this.originalThread = System.Threading.Thread.CurrentThread; this.cancellationToken = cancellationToken; this.cmdlet = cmdlet; if (cmdlet.PagingParameters != null) { WriteDebug("Client side pagination is enabled for this cmdlet"); } cmdlet.CommandRuntime = this; }
internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) { SetJobState(JobState.NotStarted); // know how to cancel/check for cancelation this.CancellationToken = cancellationToken; this.Cancel = cancelMethod; // we might need these. this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; this.originalThread = System.Threading.Thread.CurrentThread; // the instance of the cmdlet we're going to run this.cmdlet = cmdlet; // set the command runtime to the AsyncJob cmdlet.CommandRuntime = this; }
public virtual void UseCommandRuntime(ICommandRuntime2 commandRuntime) { //Logger.UseCommandRuntime(commandRuntime); Output = commandRuntime.WriteObject; ShouldProcess = commandRuntime.ShouldProcess; }
public virtual void UseCommandRuntime(ICommandRuntime2 commandRuntime) { // Do nothing }
public void UseCommandRuntime(ICommandRuntime2 commandRuntime) { _Logger.UseCommandRuntime(commandRuntime); }