Prevent initialization of nested operations

This commit is contained in:
Manuel Thalmann 2024-08-21 03:18:31 +02:00
parent 3ddd5595f9
commit 164248183d

View file

@ -23,18 +23,22 @@ $null = New-Module {
[scriptblock] $Action [scriptblock] $Action
) )
$Global:ErrorActionPreference = 'Inquire'; if (-not $Global:InOperation) {
$env:WSLENV = "CONFIG_MODULE/p"; $Global:InOperation = $true;
$Global:ErrorActionPreference = 'Inquire';
$env:WSLENV = "CONFIG_MODULE/p";
if ($env:CONFIG_MODULE) { if ($env:CONFIG_MODULE) {
$env:CONFIG_MODULE = Resolve-Path $env:CONFIG_MODULE; $env:CONFIG_MODULE = Resolve-Path $env:CONFIG_MODULE;
}
if (Test-Admin) {
Disable-WindowsUpdateAutoRestart;
}
New-Alias -Force "sudo" gsudo;
} }
if (Test-Admin) {
Disable-WindowsUpdateAutoRestart;
}
New-Alias -Force "sudo" gsudo;
& $Action; & $Action;
} }