ProcessAliases.

StartAndReturnProcess(ICakeContext, FilePath) Method

Summary

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

Syntax

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

Examples

using(var process = StartAndReturnProcess("ping"))
{
    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.

Return Value

Type Description
IProcess The newly started process.