Add a task for disabling UAC

This commit is contained in:
Manuel Thalmann 2024-08-10 00:23:37 +02:00
parent 597e1c56d4
commit ac3d5bbb0a

View file

@ -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";