Lead user through the setup properly

This commit is contained in:
Manuel Thalmann 2024-03-23 15:57:25 +01:00
parent 6d02e1bcb9
commit 60f090349c
2 changed files with 6 additions and 0 deletions

View file

@ -31,6 +31,9 @@ function New-PersonalUser([Context] $context, [string] $userName)
if (-not (Get-LocalUser $userName -ErrorAction SilentlyContinue)) {
Write-Host "Creating Personal User ``$userName``";
Get-LocalUser | Where-Object { $_.Name -in $context.UserNames } |
Disable-LocalUser;
while ($true) {
Write-Host (
[string]::Join(

View file

@ -25,5 +25,8 @@ function Install-PersonalUsers([Context] $context) {
if ($userID -ge 0) {
New-PersonalUser $context $($context.UserNames[$userID]);
Set-UserID ($userID - 1);
} else {
Get-LocalUser | Where-Object { $_.Name -in $context.UserNames } |
Enable-LocalUser;
}
}