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))