Main | Contact | Blog | Documentation

PowerShell Framework

The project dedicated to empowering your PowerShell scripting.

Configuration Schema: Default

Back to Configuration

Synopsis

The default schema is used to read the json files generated by Export-PSFConfig.

Description

As a format designed to ingest auto-generated configuration files, the default schema is not designed with human authoring comfort in mind.

It provides a maximum of data fidelity, but is generally not recommended for files not generated through Export-PSFConfig

For a json format intended for human authoring, check out the powerful MetaJson Schema.

Input Format

Each setting in the configuration file is expected in one of two formats: Simple or Complex. To define a setting as simple - which means it used full json serialization, rather than using the more complex but also more precise PSFramework syntax to specify values - when defining a configuration item in memory, use the -SimpleExport switch on Set-PSFConfig.

You can freely combine simple and complex settings with each other.

Simple format

The simple format requires three properties: Version, FullName & Data. You can also specify “Style” as “Simple”, but that is optional. All other properties on an entry are ignored.

Example:

[
  {
    "Version": 1,
    "FullName": "Demo.Simple",
    "Data": 42
  }
]

Complex Format

The complex format requires five properties: Style (as “default”), Value, Version, FullName & Type.

Example:

[
  {
    "Style": "default",
    "Value": "42",
    "Version": 1,
    "FullName": "Demo.Complex",
    "Type": 3
  }
]

Combining settings

It is perfectly legal to combine any number of settings in either style to a single file:

[
  {
    "Style": "default",
    "Value": "42",
    "Version": 1,
    "FullName": "Demo.Complex",
    "Type": 3
  },
  {
    "Version": 1,
    "FullName": "Demo.Simple",
    "Data": 42
  }
]

Back to Configuration