From 015f7d2901e8466214bd29a4c9deae8c6eabf238 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 10 Aug 2024 00:23:37 +0200 Subject: [PATCH] Add a task for disabling UAC --- scripts/Windows/OS/Install.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 1ca5581c..dc624ff4 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -8,6 +8,7 @@ using namespace System.Security.Principal; . "$PSScriptRoot/../Scripts/Security.ps1"; . "$PSScriptRoot/../Software/Firefox/Install.ps1"; . "$PSScriptRoot/../../Common/Scripts/Context.ps1"; +. "$PSScriptRoot/../../Common/Types/OneShotTask.ps1"; $null = New-Module { . "$PSScriptRoot/../Scripts/Hooks.ps1"; @@ -21,6 +22,7 @@ $null = New-Module { . "$PSScriptRoot/../../Common/Scripts/Software.ps1"; . "$PSScriptRoot/../../Common/Scripts/SoftwareManagement.ps1"; . "$PSScriptRoot/../../Common/Types/InstallerAction.ps1"; + . "$PSScriptRoot/../../Common/Types/OneShotTask.ps1"; <# .SYNOPSIS @@ -134,6 +136,20 @@ $null = New-Module { Set-Stage ([SetupStage]::Configure); break; } + ([SetupStage]::OneShot) { + Write-Host "Running a OneShot task"; + + Start-OneShot { + Write-Host "task is-a running!"; + switch (Get-OneShotTask) { + ([OneShotTask]::DisableUAC) { + Disable-UAC; + } + } + }; + + break; + } default { if (-not (& { $null = wsl -l; $? })) { wsl --import-in-place "PortValhalla" "$wslLocation/ext4.vhdx";