https://github.com/cdhunt/import-configdata
Load configuration data from multiple file types. Yaml, Toml, PSD1, JSON.
https://github.com/cdhunt/import-configdata
configuration-files devops-toolkit powershell toml yaml
Last synced: about 2 months ago
JSON representation
Load configuration data from multiple file types. Yaml, Toml, PSD1, JSON.
- Host: GitHub
- URL: https://github.com/cdhunt/import-configdata
- Owner: cdhunt
- License: apache-2.0
- Created: 2023-12-13T21:40:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-05T22:26:43.000Z (over 1 year ago)
- Last Synced: 2025-02-08T12:46:39.046Z (3 months ago)
- Topics: configuration-files, devops-toolkit, powershell, toml, yaml
- Language: PowerShell
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Import-ConfigData
Load configuration data from multiple file types.
The returned _Hashtable_ should have the same structure regardless of the source format.Currently supported types:
- [PSD1](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_data_files?view=powershell-7.4)
- [YAML](https://yaml.org/)
- [JSON](https://www.json.org/)
- [TOML](https://toml.io/)## CI Status

[](https://cdhunt.testspace.com/projects/67973/spaces)
[](https://www.powershellgallery.com/packages/Import-ConfigData)
## Install
`Install-Module -Name Import-ConfigData` or `Install-PSResource -Name Import-ConfigData`

## Docs
[Full Docs](docs)
### Getting Started
Return an object representing the contents of a PowerShell Data File.
```powershell
#config.psd1
@{
DriveName = "data"
}
``````powershell
$config = Import-ConfigData -Path config.psd1
$config.DriveName
data
```These config files all return the same PowerShell object.
```toml
#config.toml
DriveName = "data"
``````yaml
#config.yml
DriveName: data
``````json
{
"DriveName": "data"
}
```