Add users during installation
This commit is contained in:
parent
3b45035e57
commit
62db17bda2
3 changed files with 139 additions and 0 deletions
scripts/Common/Scripts
|
@ -100,6 +100,30 @@ $null = New-Module {
|
|||
Invoke-ConfigScript "getConfig $Name --json $ArgumentList";
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets a user configuration.
|
||||
|
||||
.PARAMETER UserName
|
||||
The name of the user to get the configuration for.
|
||||
|
||||
.PARAMETER Name
|
||||
The name of the configuration to get.
|
||||
#>
|
||||
function Get-UserConfig {
|
||||
param(
|
||||
[string] $UserName = $env:UserName,
|
||||
[Parameter(Mandatory, Position = 0)]
|
||||
[string] $Name
|
||||
)
|
||||
|
||||
if ((Get-Users) -contains $UserName) {
|
||||
Get-Config "valhalla.windows.users.$UserName.$Name";
|
||||
} else {
|
||||
return $null;
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets the attributes of a configuration object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue