# IResource.withRequiredCommandValidation

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResource](/reference/api/typescript/aspire.hosting/iresource.md)
- Version: `13.5.3`
- Kind: `method`

Declares that a resource requires a specific command/executable to be available on the local machine PATH before it can start, with custom validation logic.

## Definition

```typescript
interface IResource {
  // ... omitted for brevity
  withRequiredCommandValidation(command: string, validationCallback: (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult>, helpLink?: string): IResource;
}
```

## Signature

```typescript
withRequiredCommandValidation(command: string, validationCallback: (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult>, helpLink?: string): IResource
```

## Parameters

- `command` (`string`)
- `validationCallback` (`(arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult>`)
- `helpLink` (`string`) `optional`

## Returns

[IResource](/reference/api/typescript/aspire.hosting/iresource.md) `builder`

## Defined on

- [IResource](/reference/api/typescript/aspire.hosting/iresource.md) -- `interface`
