# IPipelineOutputSnapshotter<TSnapshot> Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [IPipelineOutputSnapshotter<TSnapshot>](/reference/api/csharp/aspire.hosting/ipipelineoutputsnapshotter-1.md)
- Kind: `Methods`
- Members: `1`

Captures pipeline output as provider-defined snapshots.

<a id="captureasync"></a>
<a id="captureasync-string-cancellationtoken"></a>

## CaptureAsync(string, CancellationToken)

- Name: `CaptureAsync(string, CancellationToken)`
- Modifiers: `abstract`
- Returns: `Task<TSnapshot>`

Captures the output at the supplied directory.

```csharp
public interface IPipelineOutputSnapshotter<TSnapshot>
{
    public abstract Task<TSnapshot> CaptureAsync(
        string outputDirectory,
        CancellationToken cancellationToken)
    {
        // ...
    }
}
```

## Parameters

- `outputDirectory` (`string`)
  The output directory resolved for this capture.
- `cancellationToken` (`CancellationToken`)
  The cancellation token.

## Returns

`Task<TSnapshot>` -- A snapshot of the captured output.
