public static void BlockWithProgress(CyCmdlet cmdlet, List <Task> tasks, int activityKey, string activity, string statusDescription) { var progressInfoCalculator = new PowershellProgressInfoCalculator(activityKey, activity, tasks); do { progressInfoCalculator.CalculateProgress(); progressInfoCalculator.WriteProgress(cmdlet); Task.Delay(100).Wait(); cmdlet.Logger.FlushLogsToPowershellConsole(); } while (!tasks.TrueForAll(x => x.IsCompleted)); }
/// <summary> /// Enables Powershell progress bars/messages for this activity. /// </summary> /// <param name="key"></param> /// <param name="name"></param> public void EnableProgressInfo(int key, string name) { _progressInfo = new PowershellProgressInfoCalculator(key, name, AllTasks); }