Add a function for getting the users to create
This commit is contained in:
parent
603fbdfe46
commit
3a5e8556c5
1 changed files with 29 additions and 6 deletions
|
@ -61,6 +61,27 @@ $null = New-Module {
|
|||
return $key;
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Runs a script based on the `config.fish` script.
|
||||
|
||||
.PARAMETER Script
|
||||
The script to run.
|
||||
#>
|
||||
function Invoke-ConfigScript {
|
||||
param(
|
||||
[string] $Script
|
||||
)
|
||||
|
||||
$scriptPath = "$PSScriptRoot/../../Common/Scripts/config.fish";
|
||||
|
||||
function fish {
|
||||
wsl -- nix --extra-experimental-features "nix-command flakes" nixpkgs`#fish $args
|
||||
}
|
||||
|
||||
fish -c ". $(ConvertTo-LinuxPath $scriptPath); $Script" | ConvertFrom-Json;
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets a configuration option.
|
||||
|
@ -73,13 +94,15 @@ $null = New-Module {
|
|||
[string] $Name
|
||||
)
|
||||
|
||||
$scriptPath = "$PSScriptRoot/../../Common/Scripts/config.fish";
|
||||
Invoke-ConfigScript "getConfig $Name --json";
|
||||
}
|
||||
|
||||
function fish {
|
||||
wsl -- nix --extra-experimental-features "nix-command flakes" nixpkgs`#fish $args
|
||||
}
|
||||
|
||||
fish -c ". $(ConvertTo-LinuxPath $scriptPath); getConfig $Name --json" | ConvertFrom-Json;
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets the names of the users to create.
|
||||
#>
|
||||
function Get-Users {
|
||||
Invoke-ConfigScript "getUsers";
|
||||
}
|
||||
|
||||
<#
|
||||
|
|
Loading…
Reference in a new issue