Persistence
Persistence for PowerShell Universal.
PowerShell Universal stores job output and input, identities and app tokens within the database.

LiteDB

By default, PowerShell Universal stores all data within a single file database local to the PowerShell Universal application.

Configuring LiteDB

To configure the database location for LiteDB you can edit the appsettings.json file or set the file path during installation if using the MSI. By default, the database is stored in the ProgramData directory. Update this setting to change the database location.
1
"ConnectionString": "filename=%ProgramData%\\UniversalAutomation\\database.db;upgrade=true",
Copied!
LiteDB does not support multiple instances of PowerShell Universal connecting to the same database.

SQL

This feature requires a license.
You can configure PowerShell Universal to store data within a Microsoft SQL Database. This allows you to scale out your database and PowerShell Universal instances. PowerShell Universal will automatically run jobs across the pool of agents. You can update the appsettings.json file for PowerShell Universal as follows to connect to a central SQL server.
1
"Plugins": [
2
"SQL"
3
],
4
"Data": {
5
"RepositoryPath": "%ProgramData%\\UniversalAutomation\\Repository",
6
"ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=PSUv3;Integrated Security=true;",
7
"GitRemote": "",
8
"GitUserName": "",
9
"GitPassword": "",
10
"GitBranch": "",
11
"GitSyncBehavior": "TwoWay",
12
"GitInitializeBehavior": "",
13
"ConfigurationScript": ""
14
},
Copied!
The PowerShell Universal instances will share a single job queue and only one instance will run a job either on the schedule, as a trigger, or manually. All data about jobs will be stored in the centralized database.