> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/config/repository.md).

# Repository

Configure PowerShell Universal repository storage, file-based configuration, database resources, templates, and file encoding.

PowerShell Universal primarily stores configuration in its repository. The default repository folder is `%ProgramData%\UniversalAutomation\Repository`; change the location in `appsettings.json`.

The repository contains PowerShell configuration scripts and XML files created by the admin console. PowerShell Universal watches the folder for changes and reloads the affected configuration. When Git synchronization is enabled, this is the folder synchronized with the remote repository.

All configuration cmdlets are part of the [Universal module](https://www.powershellgallery.com/packages/Universal).

## What's stored in the repository

Configuration is stored as plain text for source-control-friendly diffs. Repository-backed resources include authentication, AI agents and tools, apps, endpoints, environments, licenses, login pages, pages, published folders, rate limits, roles, schedules, scripts, settings, tags, triggers, variables, and vaults.

App tokens, identities, and job history are stored in the PowerShell Universal database.

## Editing the repository

Edit repository files in the admin console under **Source Control > Files / Repository > Files**, where you can create folders and edit files in the repository directory. You can also edit files on disk with an editor such as Visual Studio Code.

When editing on disk, enable automatic reload or resolve changes manually. View pending changes under **Source Control > Files / Repository > Configuration Changes**.

## Configuration scripts

Configuration scripts live in the `.universal` directory. The admin console maintains the generated portions of these files, while the `PSUHeader` and `PSUFooter` regions remain read-only. Use these regions for custom logic, generated resources, or classes required by OpenAPI schemas.

```powershell
#region PSUHeader

1..100 | ForEach-Object {
    New-PSUEndpoint -Url "/endpoint/$_" -Endpoint { }
}

#endregion

New-PSUEndpoint -Url '/user' -Endpoint { }

#region PSUFooter
#endregion
```

| File                             | Purpose                                                               |
| -------------------------------- | --------------------------------------------------------------------- |
| `authentication.ps1`             | Forms authentication configuration.                                   |
| `aiAgents.ps1` and `aiTools.ps1` | AI agents and tools.                                                  |
| `branding.ps1`                   | Branding settings.                                                    |
| `dashboards.ps1`                 | App registration and metadata.                                        |
| `endpoints.ps1`                  | API endpoint definitions.                                             |
| `environments.ps1`               | Execution environments.                                               |
| `healthChecks.ps1`               | Health checks.                                                        |
| `initialize.ps1`                 | Runs before configuration discovery starts.                           |
| `licenses.ps1`                   | Product license configuration.                                        |
| `middleware.ps1`                 | HTTP request customization.                                           |
| `publishedFolders.ps1`           | Published folders.                                                    |
| `rateLimits.ps1`                 | Rate limits.                                                          |
| `roles.ps1`                      | Roles.                                                                |
| `schedules.ps1`                  | Schedules.                                                            |
| `scripts.ps1`                    | Script metadata; script paths can be repository-relative or absolute. |
| `settings.ps1`                   | Platform settings.                                                    |
| `tags.ps1`                       | Tags.                                                                 |
| `triggers.ps1`                   | Triggers.                                                             |
| `variables.ps1`                  | Variables.                                                            |
| `vaults.ps1`                     | Vaults.                                                               |
| `workflows.ps1`                  | Workflow definitions when workflows use repository persistence.       |

## Templates

Use the `Templates` folder to provide templates for commonly created resources in the admin console. PowerShell scripts in the following folders appear as templates:

* `Templates\App`
* `Templates\AppPage`
* `Templates\Endpoint`
* `Templates\Script`

## .psuignore

Use `.psuignore` to exclude files and paths from the configuration file-system watcher. This is useful for logs or other files that are stored beside configuration. Add one regular expression per line; matching paths are ignored.

```
logs.*
.git.*
```

## File encoding

Configure file encoding under **Settings gear > General**. The default is UTF-8 with a byte-order mark (`utf-8-bom`). Select `utf-8` to omit the byte-order mark.

PowerShell Universal supports the encodings returned by [Encoding.GetEncodings](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.getencodings?view=net-10.0), including `utf-32`, `utf-32-bom`, `utf-8`, `utf-8-bom`, and `windows-1250`. Add `-bom` to an encoding name to include a byte-order mark.

## Database resources

You can store selected resources in the database instead of the configuration repository. Database-backed resources are available immediately across connected computers in a PowerShell Universal cluster.

> \[!WARNING] When a resource is configured for database persistence, PowerShell Universal ignores its repository configuration file.

Apps, endpoints with paths, scripts, and modules cannot use database persistence.

Configure a resource by setting `Data:Persistence:<ResourceType>` to `Database` in `appsettings.json`, then restart PowerShell Universal. For example, this stores workflows in the database instead of `.universal\workflows.ps1`:

```json
{
  "Data": {
    "Persistence": {
      "Workflow": "Database"
    }
  }
}
```

Set the equivalent environment variable before starting PowerShell Universal:

```
Data__Persistence__Workflow=Database
```

After restart, new and edited workflows are saved to the database and retained across restarts. Workflow parameters follow the parent workflow persistence setting, so they are also stored in the database. The same setting pattern applies to every supported database resource.

For example, the following stores schedules and schedule parameters in the database:

```json
{
  "Data": {
    "Persistence": {
      "Schedule": "Database",
      "ScheduleParameter": "Database"
    }
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/config/repository.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
