From dffb93707809cda39d7c8f7a18ee7a35cc0f4c5e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 19 Jul 2023 01:16:25 +0200 Subject: [PATCH] Perform initial configuration before anything else --- scripts/Windows/OS/Install.ps1 | 9 +++++---- scripts/Windows/Scripts/Prerequisites.ps1 | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index be7ee9f5..e2ad49cb 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -7,14 +7,11 @@ function Invoke-WindowsInstallation([Context] $context) { - Write-Host "Starting Installation and Restoration of Windows"; - . "$PSScriptRoot/../Scripts/Prerequisites.ps1"; - Update-WindowsInstallation $context; - if (-not $context.Get("InitialConfiguration")) { $configPath = "$PSScriptRoot/../Config"; Enable-WindowsOptionalFeature -Online -All -FeatureName "NetFx3"; + powershell -c Install-PackageProvider -Name NuGet -Force; . "$configPath/Windows/Install.ps1" $context; . "$configPath/Explorer/Install.ps1" $context; @@ -24,6 +21,10 @@ function Invoke-WindowsInstallation([Context] $context) $context.Set("InitialConfiguration", 1, "DWord"); } + Write-Host "Starting Installation and Restoration of Windows"; + . "$PSScriptRoot/../Scripts/Prerequisites.ps1"; + Update-WindowsInstallation $context; + if (-not $context.Get("SoftwarePrerequisitesInstalled")) { Write-Host "Installing prerequisites for installing software"; diff --git a/scripts/Windows/Scripts/Prerequisites.ps1 b/scripts/Windows/Scripts/Prerequisites.ps1 index 05c444ff..e0ba3091 100644 --- a/scripts/Windows/Scripts/Prerequisites.ps1 +++ b/scripts/Windows/Scripts/Prerequisites.ps1 @@ -1,6 +1,4 @@ #!/bin/pwsh -powershell -c Install-PackageProvider -Name NuGet -Force; - foreach ($module in @("PSWindowsUpdate", "KnownFolders")) { if (-not (Get-Module -ListAvailable $module))