Skip to content

Commit

Permalink
Add AsHashtable parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hunt committed Jan 5, 2024
1 parent 18cfc91 commit e3cfe0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,5 @@ FodyWeavers.xsd
*.sln.iml

*.sln

testResults.xml
4 changes: 2 additions & 2 deletions src/public/Import-ConfigData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Import-ConfigData {
.DESCRIPTION
Load configuration data from multiple file types. The returned object should look the same regardless of the source format.
.PARAMETER Path
Specifies a path to a configuration file with an extention of psd1, toml, yaml, or yml.
Specifies a path to a configuration file with an extention of psd1, toml, json, yaml, or yml.
.LINK
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_data_files?view=powershell-7.4
.LINK
Expand Down Expand Up @@ -59,7 +59,7 @@ function Import-ConfigData {
'.yml' { Import-YamlConfigData -Path $Path; break }
'.json' {
$content = Get-Content -Path $Path -Raw
$content | ConvertFrom-Json; break
$content | ConvertFrom-Json -AsHashtable; break
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/test3/TestConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Plan": [
"plan": [
{
"timeout": "0:0:10",
"headers": {
Expand Down

0 comments on commit e3cfe0c

Please sign in to comment.