public async Task <Either <PowershellFailure, Unit> > RunAsync(PsCommandBuilder builder, Func <int, Task> reportProgress = null) { using (var ps = CreateShell()) { builder.Build(ps); InitializeAsyncProgressReporting(ps, reportProgress); return(await ps.RunAsync().ConfigureAwait(false)); } }
public async Task <Either <PowershellFailure, Seq <TypedPsObject <T> > > > GetObjectsAsync <T>(PsCommandBuilder builder, Func <int, Task> reportProgress = null) { using (var ps = CreateShell()) { builder.Build(ps); InitializeAsyncProgressReporting(ps, reportProgress); return(await ps.GetObjectsAsync <T>().ConfigureAwait(false)); } }
public Either <PowershellFailure, Unit> Run(PsCommandBuilder builder, Action <int> reportProgress = null) { using (var ps = CreateShell()) { builder.Build(ps); InitializeProgressReporting(ps, reportProgress); return(ps.Run()); } }
public Either <PowershellFailure, Seq <TypedPsObject <T> > > GetObjects <T>(PsCommandBuilder builder, Action <int> reportProgress = null) { using (var ps = CreateShell()) { builder.Build(ps); InitializeProgressReporting(ps, reportProgress); return(ps.GetObjects <T>()); } }