Pause scripts on errors
This commit is contained in:
parent
ba5c46a884
commit
19900bac81
4 changed files with 6 additions and 3 deletions
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
function Invoke-WindowsInstallation([Context] $context)
|
function Invoke-WindowsInstallation([Context] $context)
|
||||||
{
|
{
|
||||||
$ErrorActionPreference = "Inquire";
|
$Global:InformationPreference = "Continue";
|
||||||
|
$Global:ErrorActionPreference = "Inquire";
|
||||||
. "$PSScriptRoot/../Scripts/Prerequisites.ps1";
|
. "$PSScriptRoot/../Scripts/Prerequisites.ps1";
|
||||||
$context.UserNames ??= @("Manuel");
|
$context.UserNames ??= @("Manuel");
|
||||||
Start-WindowsInstallation $context;
|
Start-WindowsInstallation $context;
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
function Backup-WindowsInstallation([Context] $context) {
|
function Backup-WindowsInstallation([Context] $context) {
|
||||||
Write-Information "Backing up Windows";
|
Write-Information "Backing up Windows";
|
||||||
|
$Global:InformationPreference = "Continue";
|
||||||
|
$Global:ErrorActionPreference = "Inquire";
|
||||||
. "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1";
|
. "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1";
|
||||||
$backupRoot = $context.BackupRoot();
|
$backupRoot = $context.BackupRoot();
|
||||||
Backup-PersonalFiles $context;
|
Backup-PersonalFiles $context;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#!/bin/pwsh
|
#!/bin/pwsh
|
||||||
|
$Global:InformationPreference = "Continue";
|
||||||
|
$Global:ErrorActionPreference = "Inquire";
|
||||||
$null = $env:WIN_COMPUTER_NAME;
|
$null = $env:WIN_COMPUTER_NAME;
|
||||||
$null = $env:SETUP_SCRIPT_NAME;
|
$null = $env:SETUP_SCRIPT_NAME;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/pwsh
|
#!/bin/pwsh
|
||||||
. "$PSScriptRoot/Context.ps1";
|
. "$PSScriptRoot/Context.ps1";
|
||||||
$Global:InformationPreference = "Continue";
|
|
||||||
$Global:ErrorActionPreference = "Inquire";
|
|
||||||
|
|
||||||
[Context]::new().PreventSleepMode();
|
[Context]::new().PreventSleepMode();
|
||||||
$null = powershell -c Get-PackageProvider -ListAvailable NuGet;
|
$null = powershell -c Get-PackageProvider -ListAvailable NuGet;
|
||||||
|
|
Loading…
Reference in a new issue