This is a configuration module for PowerShell. This finds configuration files, read them and convert them to Hashtable
s.
This module treats three types of configurations:
- local configuration
- user global configuration
- system global configuration
A local configuration is named $appname
.yaml and located at the current working directory or its parents recursively.
A user global configuration is named config.yaml and located at $Env:APPDATA\$appname
.
A system global configuration is named config.yaml and located at $Env:ProgramData\$appname
.
When the configurations have the same keys, upper ones overwrite.
For example there are following configurations:
# local configuration
foo: foo
# user global configuration
bar: bar
# system global configuration
bar: buzz
you get:
foo: foo
bar: bar
bar: buzz
is overwritten.
When .\foo.yaml is:
foo: 1
bar: hello
buzz:
- one
- two
call:
> Get-Config foo
Name Value
---- -----
bar hello
foo 1
buzz {one, two}