This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.Kudu.Client.
Summary
Executes an arbitrary command line and return its output.
- Assembly
- Cake
.Kudu .Client .dll - Namespace
- Cake
.Kudu .Client .Extensions - Containing Type
- Kudu
Client Command Extensions
Syntax
public static IKuduCommandResult ExecuteCommand(this IKuduClient client, string command, string directory, ProcessArgumentBuilder arguments = null)
Examples
#addin nuget:?package=Cake.Kudu.Client
string baseUri = EnvironmentVariable("KUDU_CLIENT_BASEURI"),
userName = EnvironmentVariable("KUDU_CLIENT_USERNAME"),
password = EnvironmentVariable("KUDU_CLIENT_PASSWORD");
IKuduClient kuduClient = KuduClient(
baseUri,
userName,
password);
IKuduCommandResult commandResult = kuduClient.ExecuteCommand(
"echo",
"D:/home/site/wwwroot",
"hello");
Information(
"Output:\r\n{0}\r\nError:\r\n{1}\r\nExitCode: {2}",
commandResult.Output,
commandResult.Error,
commandResult.ExitCode);
Parameters
Name | Type | Description |
---|---|---|
client | IKuduClient | The Kudu client. |
command | string | The command to execute. |
directory | string | The remote directory to execute command in. |
arguments | Process |
The arguments. |
Return Value
Type | Description |
---|---|
IKuduCommandResult | . |