Skip to content

We need to support references in settings #3

Open
@Jaykul

Description

@Jaykul

When I'm configuring complicated things, I may want to be able to define variables which I can reuse in other configurations. For instance, in a script which does software installs:

UserName = "Jaykul"
DownloadTo = "C:\Users\{UserName}\Downloads\Installers"
ConfigFolder = "{DownloadTo}\Configuration"

Currently we support tokenizing only for folder names. Maybe we could make it work for other settings by reference, like {Settings.UserName} by requiring them to be prefixed with Settings. and then resolving them after import (like paths in PoshCode) iterating to allow multiple reference levels:

UserName = "Jaykul"
Paths = @{
   DownloadTo = "C:\Users\{Settings.UserName}\Downloads\Installers"
   ConfigFolder = "{Settings.Paths.DownloadTo}\Configuration"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions