The Configuration System
The configuration system allows implementing configuration settings, similar to an options menu.
Key Features / Benefits
- Offer self-documented, validated options to user
- Make modules manageable by Group Policy or DSC
- Control scripts with configuration files
- Provide a persisting cache
- Eliminate options-commands
- Allow control over internal settings, without having to pass them out as parameters.
The configuration system is a system that maintains settings for modules. It has four common use scenarios:
A module can offer its settings in the configuration system, making them discoverable and self-documented. This basically mimicks an options menu from regular applications. It allows offering sane default values but still giving the user a voice in how something is being executed, without having to drive complexity by passing through dozens of parameters.
Users can then either change these settings per session or more permanently.
In Windows environments, it then becomes simple to apply settings by group policy. This incidentaly makes it possible to update settings at scale without having to update the module, saving a lot of hassle on company internal modules when the environment changes.
Controlling scripts through configuration at scale allows ensuring compliance in these scripts. This is generally used for non-specific settings that apply across most scripts of the entire estate, such as name of the mail server to use or where to log to.
CI / CD Pipeline
Across a CI/CD Pipeline we have the same code pass through multiple stages and environments, requiring multiple settings. The exportable/importable nature of the configuration system allows you to maintain environment specific settings as part of your code (and thus source control).
The configuration system can also be used as a data cache that persists across sessions.
Quick Start Guides
In Depth Guides
- Configuration Basics
- Implementing Validation
- Using Handler Events
- In Hiding
- The mysterious Initialize
- Configuration Persistence Basics
- The Automatic Import Sequence
- Where configuration is stored
- Manually importing & exporting Configuration
- Persisted Module Cache
- Purging persisted data
- Persistence and Serialization