Allow driver installation during setup

This commit is contained in:
Manuel Thalmann 2023-07-14 09:24:13 +02:00
parent feed405e65
commit 629978a897
2 changed files with 17 additions and 0 deletions

View file

@ -1,4 +1,5 @@
#!/bin/pwsh #!/bin/pwsh
. "$PSScriptRoot/Drivers.ps1";
. "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1"; . "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1";
. "$PSScriptRoot/../../../scripts/Windows/Scripts/Context.ps1"; . "$PSScriptRoot/../../../scripts/Windows/Scripts/Context.ps1";

View file

@ -1,4 +1,5 @@
#!/bin/pwsh #!/bin/pwsh
. "$PSScriptRoot/Drivers.ps1";
. "$PSScriptRoot/Manage.ps1"; . "$PSScriptRoot/Manage.ps1";
. "$PSScriptRoot/Upgrade.ps1"; . "$PSScriptRoot/Upgrade.ps1";
. "$PSScriptRoot/User.ps1"; . "$PSScriptRoot/User.ps1";
@ -9,6 +10,21 @@ function Invoke-WindowsInstallation([Context] $context)
Write-Host "Starting Installation and Restoration of Windows"; Write-Host "Starting Installation and Restoration of Windows";
. "$PSScriptRoot/../Scripts/Prerequisites.ps1"; . "$PSScriptRoot/../Scripts/Prerequisites.ps1";
Update-WindowsInstallation $context; Update-WindowsInstallation $context;
if (-not $context.Get("DriversInstalled")) {
Write-Host "Installing Drivers";
Write-Information "Looking for driver installation function";
if ((Get-Command Install-Drivers -ErrorAction SilentlyContinue)) {
Write-Information "Driver installation function was found. Starting installation";
Install-Drivers $context;
}
Write-Information "Finished installing drivers";
$context.Set("DriversInstalled", 1);
}
New-PersonalUser $context; New-PersonalUser $context;
Restore-WindowsInstallation $context; Restore-WindowsInstallation $context;
} }