Nest installation functions in a module

This commit is contained in:
Manuel Thalmann 2024-08-01 19:02:12 +02:00
parent 5bb1a19a1f
commit 9b6cdd24e5

View file

@ -12,19 +12,20 @@
. "$PSScriptRoot/../Scripts/Update.ps1";
. "$PSScriptRoot/../Software/Firefox/Install.ps1";
<#
$null = New-Module {
<#
.SYNOPSIS
Finishes the installation of a running Windows machine.
#>
function Start-WindowsInstallation {
#>
function Start-WindowsInstallation {
Start-InstallationLoop;
}
}
<#
<#
.SYNOPSIS
Starts the installation loop.
#>
function Start-InstallationLoop {
#>
function Start-InstallationLoop {
while (-not (Get-IsFinished)) {
if ($null -eq (Get-Stage)) {
Set-Stage ([SetupStage]::Initialize);
@ -115,16 +116,16 @@ function Start-InstallationLoop {
}
}
}
}
}
function Invoke-WindowsInstallation([Context] $context) {
function Invoke-WindowsInstallation([Context] $context) {
$Global:InformationPreference = "Continue";
$Global:ErrorActionPreference = "Inquire";
$context.UserNames ??= @("Manuel");
Start-OldWindowsInstallationScript $context;
}
}
function Start-OldWindowsInstallationScript([Context] $context) {
function Start-OldWindowsInstallationScript([Context] $context) {
. "$PSScriptRoot/Upgrade.ps1";
$finished = $false;
Remove-Item Env:\POSH_THEME -ErrorAction SilentlyContinue;
@ -221,4 +222,5 @@ function Start-OldWindowsInstallationScript([Context] $context) {
}
}
}
}
}
};