From a61ef921bdbcdb6c1c7bbb508e9e7e4e09e01c0e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 24 Aug 2024 16:56:29 +0200 Subject: [PATCH] Keep Windows fixes separate --- scripts/Common/Scripts/Operations.ps1 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/Common/Scripts/Operations.ps1 b/scripts/Common/Scripts/Operations.ps1 index cd085a93..5527e310 100644 --- a/scripts/Common/Scripts/Operations.ps1 +++ b/scripts/Common/Scripts/Operations.ps1 @@ -39,18 +39,21 @@ $null = New-Module { $Global:InOperation = $true; $Global:ErrorActionPreference = $NonInteractive.IsPresent ? 'Continue' : 'Inquire'; - $env:WSLENV = "CONFIG_MODULE/p"; - if ($env:CONFIG_MODULE) { - $env:CONFIG_MODULE = Resolve-Path $env:CONFIG_MODULE; + if ($IsWindows) { + $env:WSLENV = "CONFIG_MODULE/p"; + + if ($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; - if (-not $NoImplicitCleanup.IsPresent) { $cleanup = { Clear-OperationResources;