public ScriptJobExecutionEngine Load(ScriptJobBase scriptJob, string workingFolderPath = null)
        {
            // Validate/Record.
            this.ScriptJob = scriptJob ?? throw new Exception("Provided ScriptJob is NULL");

            // Set working folder.
            if (!string.IsNullOrEmpty(workingFolderPath))
            {
                this.ScriptJob.WorkingFolderPath = workingFolderPath;
            }
            else
            {
                this.ScriptJob.WorkingFolderPath = ReflectionHelper.GetExecutingAssemblyFolderPath();
            }

            return(this);
        }
 public static async Task ExecuteAsync(ScriptJobBase scriptJob, string workingFolderPath = null)
 {
     await new ScriptJobExecutionEngine().Load(scriptJob, workingFolderPath).ExecuteAsync();
 }
 public static void Execute(ScriptJobBase scriptJob, string workingFolderPath = null)
 {
     new ScriptJobExecutionEngine().Load(scriptJob, workingFolderPath).Execute();
 }