From 19900bac81e7431627a3a305b3b6296567c6910a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 23 Mar 2024 17:32:45 +0100 Subject: [PATCH] Pause scripts on errors --- scripts/Windows/OS/Install.ps1 | 3 ++- scripts/Windows/OS/Manage.ps1 | 2 ++ scripts/Windows/OS/Setup.ps1 | 2 ++ scripts/Windows/Scripts/Prerequisites.ps1 | 2 -- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index bbcbea91..05e5aa59 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -7,7 +7,8 @@ function Invoke-WindowsInstallation([Context] $context) { - $ErrorActionPreference = "Inquire"; + $Global:InformationPreference = "Continue"; + $Global:ErrorActionPreference = "Inquire"; . "$PSScriptRoot/../Scripts/Prerequisites.ps1"; $context.UserNames ??= @("Manuel"); Start-WindowsInstallation $context; diff --git a/scripts/Windows/OS/Manage.ps1 b/scripts/Windows/OS/Manage.ps1 index fa415323..624e387c 100644 --- a/scripts/Windows/OS/Manage.ps1 +++ b/scripts/Windows/OS/Manage.ps1 @@ -7,6 +7,8 @@ function Backup-WindowsInstallation([Context] $context) { Write-Information "Backing up Windows"; + $Global:InformationPreference = "Continue"; + $Global:ErrorActionPreference = "Inquire"; . "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1"; $backupRoot = $context.BackupRoot(); Backup-PersonalFiles $context; diff --git a/scripts/Windows/OS/Setup.ps1 b/scripts/Windows/OS/Setup.ps1 index fcfd2f65..1f584671 100644 --- a/scripts/Windows/OS/Setup.ps1 +++ b/scripts/Windows/OS/Setup.ps1 @@ -1,4 +1,6 @@ #!/bin/pwsh +$Global:InformationPreference = "Continue"; +$Global:ErrorActionPreference = "Inquire"; $null = $env:WIN_COMPUTER_NAME; $null = $env:SETUP_SCRIPT_NAME; diff --git a/scripts/Windows/Scripts/Prerequisites.ps1 b/scripts/Windows/Scripts/Prerequisites.ps1 index 4d0ed723..93b89f09 100644 --- a/scripts/Windows/Scripts/Prerequisites.ps1 +++ b/scripts/Windows/Scripts/Prerequisites.ps1 @@ -1,7 +1,5 @@ #!/bin/pwsh . "$PSScriptRoot/Context.ps1"; -$Global:InformationPreference = "Continue"; -$Global:ErrorActionPreference = "Inquire"; [Context]::new().PreventSleepMode(); $null = powershell -c Get-PackageProvider -ListAvailable NuGet;