# addScript

- Module: [CommunityToolkit.Aspire.Hosting.PowerShell](/reference/api/typescript/communitytoolkit.aspire.hosting.powershell.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

Adds a PowerShell script resource to the distributed application.

## Definition

```typescript
interface PowerShellRunspacePoolResource {
  // ... omitted for brevity
  addScript(
    name: string,
    script: string): PowerShellScriptResource
}
```

## Parameters

- `name` (`string`)
- `script` (`string`)

## Returns

[PowerShellScriptResource](/reference/api/typescript/communitytoolkit.aspire.hosting.powershell/powershellscriptresource.md) `builder`

## Applies to

- [PowerShellRunspacePoolResource](/reference/api/typescript/communitytoolkit.aspire.hosting.powershell/powershellrunspacepoolresource.md)
