diff --git a/scripts/Common/Scripts/Config.ps1 b/scripts/Common/Scripts/Config.ps1 index b33c0b0a..a43c22b0 100644 --- a/scripts/Common/Scripts/Config.ps1 +++ b/scripts/Common/Scripts/Config.ps1 @@ -91,11 +91,28 @@ $null = New-Module { The name of the option to get. #> function Get-Config { + param( + [string] $Name, + [Parameter(ValueFromRemainingArguments)] + [string[]] $ArgumentList + ) + + Invoke-ConfigScript "getConfig $Name --json $ArgumentList"; + } + + <# + .SYNOPSIS + Gets the attributes of a configuration object. + + .PARAMETER Name + The name of the configuration to get the attributes of. + #> + function Get-Attributes { param( [string] $Name ) - Invoke-ConfigScript "getConfig $Name --json"; + Invoke-ConfigScript "getAttributes $Name"; } <# @@ -103,7 +120,7 @@ $null = New-Module { Gets the names of the users to create. #> function Get-Users { - Invoke-ConfigScript "getUsers"; + Get-Attributes "valhalla.windows.users"; } <# diff --git a/scripts/Common/Scripts/config.fish b/scripts/Common/Scripts/config.fish index 1b44d34f..88f551ae 100755 --- a/scripts/Common/Scripts/config.fish +++ b/scripts/Common/Scripts/config.fish @@ -8,8 +8,12 @@ function getConfig -S -a property evalModule "$CONFIG_MODULE" "$property" $argv[2..] end +function getAttributes -S -a property + getConfig "$property" --apply "builtins.attrNames" --json +end + function getUsers -S - getConfig valhalla.users --apply "builtins.attrNames" --json + getAttributes "valhalla.users" end function isSet -S -a property