public override void Execute(IDictionary <string, object> input) { var source = input.Get <string>(SOURCE); var cmd = _collectionProvider.GetSetting(Definitions.SettingPathForFfmpeg, true); if (cmd == null) { return; } var files = Directory.GetFiles(source, "*.gif"); var argsTemplate = "-f gif -i {{GifFile}} {{Mp4File}}"; var invoker = new CommandLineInvoker(cmd, "") { InvokeMode = CommandLineInvokerMode.UseNoShell }; foreach (var file in files) { var name = Path.GetFileNameWithoutExtension(file); var args = argsTemplate.FormatLiquid(new { GifFile = file, Mp4File = Path.Combine(source, name + ".mp4") }); var output = invoker.Start(args); _console.WriteLine(output); } }
public TaskResult Execute(RoboCopyTaskInput input) { input.Options = string.IsNullOrEmpty(input.Options) ? "/e /MIR /np /ns" : input.Options; var arguments = "{{Source}} {{Destination}} {{Files}} {{Options}}".FormatLiquid(input); var invoker = new CommandLineInvoker("robocopy.exe", arguments); //var result = invoker.Start(); invoker.Start(); return(TaskResult.Success()); }
public override void Execute(IDictionary <string, object> input) { var path = input.Get <string>(PATH); var args = input.Get <string>(ARGS); var invoker = new CommandLineInvoker(path, args) { InvokeMode = CommandLineInvokerMode.UseNoShell }; var output = invoker.Start(); _console.WriteLine(output); }
public override void Execute(IDictionary <string, object> input) { var source = input.Get <string>(SOURCE); var target = input.Get <string>(TARGET); var sourceValue = _collectionProvider.GetValue(CollectionValues.SymlinkSource, source); var targetValue = _collectionProvider.GetValue(CollectionValues.SymlinkTarget, target); var parameters = @"/c mklink /j ""{targetValue}"" ""{sourceValue}""" .FormatLiquid(new { sourceValue, targetValue }); var invoker = new CommandLineInvoker("cmd.exe", parameters) { InvokeMode = CommandLineInvokerMode.UseNoShell }; invoker.Start(); }
public override void Execute(IDictionary<string, object> input) { var path = input.Get<string>(PATH); var port = input.Get<int>(PORT); var pathIISExpress = _collectionProvider.GetSetting(Definitions.SettingPathForIISExpress, true); if (string.IsNullOrEmpty(pathIISExpress)) { _console.WriteLine("path for executable IIS Express not found. Operation cancelled"); return; } var template = "/path:{{ path }} /port:{{ port }}"; var cmd = template.FormatLiquid(new {path, port}); var invoker = new CommandLineInvoker(pathIISExpress, cmd) { InvokeMode = CommandLineInvokerMode.UseNoShell }; /*var result = */invoker.Start(); }
public override void Execute(IDictionary <string, object> input) { var site = input.Get <string>(SITE); var name = input.Get <string>(NAME); var appcmdPath = _collectionProvider.GetSetting(Definitions.SettingPathForAppcmd, true); if (string.IsNullOrEmpty(appcmdPath)) { _console.WriteLine("path for executable Appcmd not found. Operation cancelled"); return; } var template = "delete app \"/app.name:{{site}}/{{name}}"; var cmd = template.FormatLiquid(new { name, site }); var invoker = new CommandLineInvoker(appcmdPath, cmd); var result = invoker.Start(); _console.WriteLine(result); }
public override void Execute(IDictionary <string, object> input) { var name = input.Get <string>(POOL); var framework = input.Get <string>(FRAMEWORK); var pathAppcmd = _collectionProvider.GetSetting(Definitions.SettingPathForAppcmd, true); if (string.IsNullOrEmpty(pathAppcmd)) { _console.WriteLine("path for executable Appcmd not found. Operation cancelled"); return; } var runtime = GetRuntime(framework); var pipe = GetPipemode(); var template = "add apppool \"/name:{{name}}\" \"/managedRuntimeVersion:{{runtime}}\" \"/managedPipelineMode:{{pipe}}\""; var cmd = template.FormatLiquid(new { name, runtime, pipe }); var invoker = new CommandLineInvoker(pathAppcmd, cmd); var result = invoker.Start(); _console.WriteLine(result); }
public override void Execute(IDictionary <string, object> input) { var site = input.Get <string>(SITE); var name = input.Get <string>(NAME); var path = input.Get <string>(PATH); var pool = input.Get <string>(POOL); var pathAppcmd = _collectionProvider.GetSetting(Definitions.SettingPathForAppcmd, true); if (string.IsNullOrEmpty(pathAppcmd)) { _console.WriteLine("path for executable Appcmd not found. Operation cancelled"); return; } var template = "add app \"/site.name:{{site}}\" /path:/{{name}} \"/physicalPath:{{path}}\" {{usePool}}"; var usePool = !string.IsNullOrEmpty(pool) ? "/applicationPool:" + pool : ""; var cmd = template.FormatLiquid(new { name, site, path, usePool }); var invoker = new CommandLineInvoker(pathAppcmd, cmd); var result = invoker.Start(); _console.WriteLine(result); }