Add a function for checking whether a setup is being run

This commit is contained in:
Manuel Thalmann 2024-08-06 14:32:37 +02:00
parent 76a9004e3c
commit 44d4bdb7ec

View file

@ -214,6 +214,14 @@ $null = New-Module {
Get-Config "valhalla.software.$Name";
}
<#
.SYNOPSIS
Checks whether the current user is the setup user.
#>
function Test-SetupUser {
$env:UserName -eq (Get-Config "valhalla.windows.setupUser");
}
<#
.SYNOPSIS
Checks whether the active session is executed with admin rights.