From b40ba593a356e747cb77780b5c70c82d8091f23e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Jun 2023 19:58:01 +0200 Subject: [PATCH] Add dedicated script for installing prerequisites --- profiles/DerGeret/Backup.ps1 | 1 + profiles/DerGeret/Restore.ps1 | 1 + scripts/Windows/OS/Setup.ps1 | 8 -------- scripts/Windows/Scripts/Prerequisites.ps1 | 7 +++++++ 4 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 scripts/Windows/Scripts/Prerequisites.ps1 diff --git a/profiles/DerGeret/Backup.ps1 b/profiles/DerGeret/Backup.ps1 index c69830d2..15732b53 100644 --- a/profiles/DerGeret/Backup.ps1 +++ b/profiles/DerGeret/Backup.ps1 @@ -1,3 +1,4 @@ +. "$PSScriptRoot/../../scripts/Windows/Scripts/Prerequisites.ps1"; . "$PSScriptRoot/../../scripts/Windows/Scripts/Context.ps1"; . "$PSScriptRoot/../../scripts/Windows/OS/Manage.ps1"; diff --git a/profiles/DerGeret/Restore.ps1 b/profiles/DerGeret/Restore.ps1 index 2d177f1e..10d9ab22 100644 --- a/profiles/DerGeret/Restore.ps1 +++ b/profiles/DerGeret/Restore.ps1 @@ -1,3 +1,4 @@ +. "$PSScriptRoot/../../scripts/Windows/Scripts/Prerequisites.ps1"; . "$PSScriptRoot/../../scripts/Windows/Scripts/Context.ps1"; $null = New-Module { diff --git a/scripts/Windows/OS/Setup.ps1 b/scripts/Windows/OS/Setup.ps1 index cb153bb4..b522c5ca 100644 --- a/scripts/Windows/OS/Setup.ps1 +++ b/scripts/Windows/OS/Setup.ps1 @@ -1,11 +1,3 @@ -foreach ($module in @("PSWindowsUpdate")) -{ - if (-not (Get-Module $module)) - { - Install-Module -AcceptLicense -Force "$module"; - } -} - Import-Module PSWindowsUpdate; Import-Module ScheduledTasks; diff --git a/scripts/Windows/Scripts/Prerequisites.ps1 b/scripts/Windows/Scripts/Prerequisites.ps1 new file mode 100644 index 00000000..fa6a8931 --- /dev/null +++ b/scripts/Windows/Scripts/Prerequisites.ps1 @@ -0,0 +1,7 @@ +foreach ($module in @("PSWindowsUpdate", "KnownFolders")) +{ + if (-not (Get-Module $module)) + { + Install-Module -AcceptLicense -Force "$module"; + } +}