ProcessAliases.

StartAndReturnProcess(ICakeContext, FilePath, ProcessSettings) Method

Summary

Starts the process resource that is specified by the filename and settings.
Namespace
Cake.Common
Containing Type
ProcessAliases

Syntax

[CakeMethodAlias]
public static IProcess StartAndReturnProcess(this ICakeContext context, FilePath fileName, ProcessSettings settings)

Examples

using(var process = StartAndReturnProcess("ping", new ProcessSettings{ Arguments = "localhost" }))
{
    process.WaitForExit();
    // This should output 0 as valid arguments supplied
    Information("Exit code: {0}", process.GetExitCode());
}

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.

Parameters

Name Type Description
context ICakeContext The context.
fileName FilePath Name of the file.
settings ProcessSettings The settings.

Return Value

Type Description
IProcess The newly started process.