Add functions for retrieving attributes
This commit is contained in:
parent
4aec5d4b53
commit
6cd1cbb541
2 changed files with 24 additions and 3 deletions
|
@ -91,11 +91,28 @@ $null = New-Module {
|
||||||
The name of the option to get.
|
The name of the option to get.
|
||||||
#>
|
#>
|
||||||
function Get-Config {
|
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(
|
param(
|
||||||
[string] $Name
|
[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.
|
Gets the names of the users to create.
|
||||||
#>
|
#>
|
||||||
function Get-Users {
|
function Get-Users {
|
||||||
Invoke-ConfigScript "getUsers";
|
Get-Attributes "valhalla.windows.users";
|
||||||
}
|
}
|
||||||
|
|
||||||
<#
|
<#
|
||||||
|
|
|
@ -8,8 +8,12 @@ function getConfig -S -a property
|
||||||
evalModule "$CONFIG_MODULE" "$property" $argv[2..]
|
evalModule "$CONFIG_MODULE" "$property" $argv[2..]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getAttributes -S -a property
|
||||||
|
getConfig "$property" --apply "builtins.attrNames" --json
|
||||||
|
end
|
||||||
|
|
||||||
function getUsers -S
|
function getUsers -S
|
||||||
getConfig valhalla.users --apply "builtins.attrNames" --json
|
getAttributes "valhalla.users"
|
||||||
end
|
end
|
||||||
|
|
||||||
function isSet -S -a property
|
function isSet -S -a property
|
||||||
|
|
Loading…
Reference in a new issue