Summary
Executes a generic command based on arguments and settings.
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Command")]
public static void Command(this ICakeContext context, CommandSettings settings, ProcessArgumentBuilder arguments = null)
Examples
#tool dotnet:?package=DPI&version=2022.8.21.54
// Reusable tools settings i.e. created in setup.
var settings = new CommandSettings {
ToolName = "DPI",
ToolExecutableNames = new []{ "dpi", "dpi.exe"},
};
// Example with ProcessArgumentBuilder
Command(
settings,
new ProcessArgumentBuilder()
.Append("nuget")
.AppendQuoted(Context.Environment.WorkingDirectory.FullPath)
.AppendSwitch("--output", " ", "TABLE")
.Append("analyze")
);
// Example with implicit ProcessArgumentBuilder
Command(
settings,
$"nuget --output TABLE analyze"
);
Attributes
Parameters
Return Value