From e3e998a4a4029efc529dc130970bca73442bf90b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 29 Jul 2023 03:37:43 +0200 Subject: [PATCH] Prevent sleep mode for all actions --- scripts/Windows/OS/Install.ps1 | 1 - scripts/Windows/Scripts/Prerequisites.ps1 | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 6d71f9ab..5b78cf1c 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -14,7 +14,6 @@ function Invoke-WindowsInstallation([Context] $context) $null = Enable-WindowsOptionalFeature -Online -All -FeatureName "NetFx3"; - $context.PreventSleepMode(); . "$configPath/Windows/Install.ps1" $context; . "$configPath/Explorer/Install.ps1" $context; . "$configPath/OpenSSH/Install.ps1" $context; diff --git a/scripts/Windows/Scripts/Prerequisites.ps1 b/scripts/Windows/Scripts/Prerequisites.ps1 index 69261ddb..1d250d33 100644 --- a/scripts/Windows/Scripts/Prerequisites.ps1 +++ b/scripts/Windows/Scripts/Prerequisites.ps1 @@ -1,7 +1,9 @@ #!/bin/pwsh +. "$PSScriptRoot/Context.ps1"; $Global:InformationPreference = "Continue"; $Global:ErrorActionPreference = "Inquire"; +[Context]::new().PreventSleepMode(); $null = powershell -c Get-PackageProvider -ListAvailable NuGet; if (-not $?) {