Add users during installation

This commit is contained in:
Manuel Thalmann 2024-08-08 17:49:43 +02:00
parent 3b45035e57
commit 62db17bda2
3 changed files with 139 additions and 0 deletions
scripts/Common/Scripts

View file

@ -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.