From 13207c0d4af624118a5dc3d49e53837f0bdca379 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 27 Sep 2023 12:32:27 +0200 Subject: [PATCH] Allow specifying custom app installer function --- profiles/DerGeret/Windows/Restore.ps1 | 6 ++++++ scripts/Windows/OS/Manage.ps1 | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/profiles/DerGeret/Windows/Restore.ps1 b/profiles/DerGeret/Windows/Restore.ps1 index 14e03cdb..7027962a 100644 --- a/profiles/DerGeret/Windows/Restore.ps1 +++ b/profiles/DerGeret/Windows/Restore.ps1 @@ -2,11 +2,17 @@ . "$PSScriptRoot/Drivers.ps1"; . "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1"; . "$PSScriptRoot/../../../scripts/Windows/Scripts/Context.ps1"; +. "$PSScriptRoot/../../../scripts/Windows/Collections/Personal.ps1" function Initialize-Configuration { Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Value 1 -Type "DWord"; } +function Restore-Apps { + param([Context] $context) + Restore-PersonalApps $context; +} + Write-Host "Starting Restoration of Windows"; . "$PSScriptRoot/../../../scripts/Windows/OS/Install.ps1"; [Context]$context = [Context]::new(); diff --git a/scripts/Windows/OS/Manage.ps1 b/scripts/Windows/OS/Manage.ps1 index 1e2db696..67488a94 100644 --- a/scripts/Windows/OS/Manage.ps1 +++ b/scripts/Windows/OS/Manage.ps1 @@ -48,7 +48,11 @@ function Restore-WindowsInstallation([Context] $context) { Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $False; Restore-PersonalFiles $context; - Restore-PersonalApps $context; + + if ((Get-Command Restore-Apps -ErrorAction SilentlyContinue)) { + Restore-Apps $context; + } + Remove-Item -Recurse $context.RootDir; $context.Cleanup(); }