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 40a422bb8e
commit 6e3e8eb4b3

View file

@ -214,6 +214,14 @@ $null = New-Module {
Get-Config "valhalla.software.$Name"; 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 .SYNOPSIS
Checks whether the active session is executed with admin rights. Checks whether the active session is executed with admin rights.