# ProcessCommandOptions Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ProcessCommandOptions](/reference/api/csharp/aspire.hosting/processcommandoptions.md)
- Kind: `Properties`
- Members: `4`

Optional configuration for resource process commands added with [ResourceBuilderExtensions.WithProcessCommand(IResourceBuilder<TResource>, string, string, string, IReadOnlyList<string>, ProcessCommandOptions?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withprocesscommand-iresourcebuilder-tresource-string-string-string-ireadonlylist-string-processcommandoptions).

## DisplayImmediately

- Name: `DisplayImmediately`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ProcessCommandOptions.cs)

Gets or sets a value indicating whether returned command output should be displayed immediately in the dashboard.

```csharp
public bool DisplayImmediately { get; set; }
```

## Remarks

The default value is `true`.

This option is not applied by default result handling when [ProcessCommandOptions.GetCommandResult](/reference/api/csharp/aspire.hosting/processcommandoptions/properties.md#getcommandresult) is specified.

## GetCommandResult

- Name: `GetCommandResult`
- Modifiers: `nullable` `get; set`
- Returns: `Func<ProcessCommandResultContext, Task<ExecuteCommandResult>>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ProcessCommandOptions.cs)

Gets or sets a callback to be invoked after the process exits to determine the result of the command invocation.

```csharp
public Func<ProcessCommandResultContext, Task<ExecuteCommandResult>>? GetCommandResult { get; set; }
```

## Remarks

When specified, [ProcessCommandOptions.SuccessExitCodes](/reference/api/csharp/aspire.hosting/processcommandoptions/properties.md#successexitcodes), [ProcessCommandOptions.MaxOutputLineCount](/reference/api/csharp/aspire.hosting/processcommandoptions/properties.md#maxoutputlinecount), and [ProcessCommandOptions.DisplayImmediately](/reference/api/csharp/aspire.hosting/processcommandoptions/properties.md#displayimmediately) are not applied by the default result handling. The callback can use [ProcessCommandResultContext.GetFormattedOutput(int, string)](/reference/api/csharp/aspire.hosting/processcommandresultcontext/methods.md#getformattedoutput-int-string) to format retained process output.

## MaxOutputLineCount

- Name: `MaxOutputLineCount`
- Modifiers: `get; set`
- Returns: `int`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ProcessCommandOptions.cs)

Gets or sets the maximum number of stdout and stderr output lines returned as command result data.

```csharp
public int MaxOutputLineCount { get; set; }
```

## Remarks

Standard output and standard error are captured together in the order observed by the process runner. The returned command result contains the retained tail of the combined output as plain text.

This option is not applied by default result handling when [ProcessCommandOptions.GetCommandResult](/reference/api/csharp/aspire.hosting/processcommandoptions/properties.md#getcommandresult) is specified.

## SuccessExitCodes

- Name: `SuccessExitCodes`
- Modifiers: `get; set`
- Returns: `IReadOnlyList<int>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ProcessCommandOptions.cs)

Gets or sets the exit codes that are treated as a successful command invocation when [ProcessCommandOptions.GetCommandResult](/reference/api/csharp/aspire.hosting/processcommandoptions/properties.md#getcommandresult) is not specified.

```csharp
public IReadOnlyList<int> SuccessExitCodes { get; set; }
```

## Remarks

The default value is `[0]`.
