diff --git a/profiles/DerGeret/Windows/Restore.ps1 b/profiles/DerGeret/Windows/Restore.ps1 index f6d9c202..f9fa93aa 100644 --- a/profiles/DerGeret/Windows/Restore.ps1 +++ b/profiles/DerGeret/Windows/Restore.ps1 @@ -1,4 +1,5 @@ #!/bin/pwsh +. "$PSScriptRoot/Drivers.ps1"; . "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1"; . "$PSScriptRoot/../../../scripts/Windows/Scripts/Context.ps1"; diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 8fdbd00f..145a4cd7 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -1,4 +1,5 @@ #!/bin/pwsh +. "$PSScriptRoot/Drivers.ps1"; . "$PSScriptRoot/Manage.ps1"; . "$PSScriptRoot/Upgrade.ps1"; . "$PSScriptRoot/User.ps1"; @@ -9,6 +10,21 @@ function Invoke-WindowsInstallation([Context] $context) Write-Host "Starting Installation and Restoration of Windows"; . "$PSScriptRoot/../Scripts/Prerequisites.ps1"; 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; Restore-WindowsInstallation $context; }