From 0ccc8705845250e9c178c780d8b9549e50ce19a7 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 22 Jun 2023 19:02:02 +0200 Subject: [PATCH] Add further log messages --- profiles/DerGeret/Windows/Backup.ps1 | 3 +++ scripts/Windows/OS/Manage.ps1 | 4 ++++ scripts/Windows/Scripts/PersonalFiles.ps1 | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/profiles/DerGeret/Windows/Backup.ps1 b/profiles/DerGeret/Windows/Backup.ps1 index 8c4c346b..121dec3a 100644 --- a/profiles/DerGeret/Windows/Backup.ps1 +++ b/profiles/DerGeret/Windows/Backup.ps1 @@ -3,7 +3,10 @@ . "$PSScriptRoot/../../../scripts/Windows/OS/Manage.ps1"; $null = New-Module { + Write-Host "Starting Backup of Windows"; $context = [Context]::new(); $context.BackupName = $env:BACKUP_NAME ?? $(Read-Host -Prompt "Please enter a backup name"); Invoke-WindowsBackup $context; + Write-Host "Never forget to store the backup somewhere safe!"; + Write-Host "I mean... what kind of a dumbass would ever forget to do so, right?"; } diff --git a/scripts/Windows/OS/Manage.ps1 b/scripts/Windows/OS/Manage.ps1 index 80fe039e..98223626 100644 --- a/scripts/Windows/OS/Manage.ps1 +++ b/scripts/Windows/OS/Manage.ps1 @@ -13,6 +13,7 @@ . "$PSScriptRoot/../Software/VisualStudio/Manage.ps1"; function Invoke-WindowsBackup([Context] $context) { + Write-Information "Backing up Windows"; $backupRoot = $context.BackupRoot(); Invoke-FileBackup $context; Invoke-BackupGit $context; @@ -30,6 +31,8 @@ function Invoke-WindowsBackup([Context] $context) { } function Invoke-WindowsRestore([Context] $context) { + Write-Host "Restoring Windows"; + function Read-Path() { $backupPath = Read-Host -Prompt "Please enter the path to the archive load the backup from."; @@ -45,6 +48,7 @@ function Invoke-WindowsRestore([Context] $context) { } } + Write-Information "Determining Backup Archive Path"; $backupPath = Read-Path; $context = [Context]::new(); $context.BackupName ??= "PortValhalla"; diff --git a/scripts/Windows/Scripts/PersonalFiles.ps1 b/scripts/Windows/Scripts/PersonalFiles.ps1 index 97b14435..b9cd83e0 100644 --- a/scripts/Windows/Scripts/PersonalFiles.ps1 +++ b/scripts/Windows/Scripts/PersonalFiles.ps1 @@ -12,12 +12,16 @@ function Get-BackupCandidates() { } function Invoke-FileBackup([Context] $context) { + Write-Host "Backing up Personal Files"; + foreach ($candidate in Get-BackupCandidates) { $context.Backup($candidate[1], $context.FileArchivePath($candidate[0]), $candidate[2]); } } function Invoke-FileRestore([Context] $context) { + Write-Host "Restoring Personal Files"; + foreach ($candidate in Get-BackupCandidates) { $archivePath = $context.FileArchivePath($candidate[0]);