Skip to content

globalSettings.json

When using Get-SettingsFromFile you can use this file to store settings for your scripts in. The file consists of at least one JSON-object, from now on referred to as "block", called global.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    "global":{
        "setting1":"globalValue1",
        "setting2":"globalValueDetermined by template"
    },
    "scriptspecific":{
        "setting2" : "__globalValue__",
        "setting3" : "scriptValue3",
        "LogOutputLevel": "VERBOSE"
    }
}

global

Settings stored in this "block" can be accessed from other blocks. In the example above we use the value for setting2 from the global block.

scriptspecific

You can add how many "blocks" you like, one for each script you write. In the example above we have a script calle scriptspecific.ps1 that have some settings for.

Further reading

For more information on how the settings can be used, please read Best practices and Get-SettingsFromFile.