Create separate script for handling app backups

This commit is contained in:
Manuel Thalmann 2023-06-30 12:24:12 +02:00
parent 9758a6428f
commit c9094c7d04
2 changed files with 33 additions and 24 deletions

View file

@ -0,0 +1,30 @@
. "$PSScriptRoot/../Scripts/Context.ps1";
. "$PSScriptRoot/../Software/git/Manage.ps1";
. "$PSScriptRoot/../Software/LGHub/Manage.ps1";
. "$PSScriptRoot/../Software/ManiaPlanet/Manage.ps1";
. "$PSScriptRoot/../Software/osu!/Manage.ps1";
. "$PSScriptRoot/../Software/osu!lazer/Manage.ps1";
. "$PSScriptRoot/../Software/PuTTY/Manage.ps1";
. "$PSScriptRoot/../Software/RetroArch/Manage.ps1";
. "$PSScriptRoot/../Software/reWASD/Manage.ps1";
. "$PSScriptRoot/../Software/TrackMania Nations Forever/Manage.ps1";
. "$PSScriptRoot/../Software/TrackMania United Forever/Manage.ps1";
. "$PSScriptRoot/../Software/VisualStudio/Manage.ps1";
function Backup-PersonalApps([Context] $context) {
Backup-Git $context;
Backup-LogitechGHUB $context;
Backup-ManiaPlanet $context;
Backup-Osu $context;
Backup-OsuLazer $context;
Backup-PuTTY $context;
Backup-RetroArch $context;
Backup-reWASD $context;
Backup-TmNations $context;
Backup-TmUnited $context;
Backup-VisualStudio $context;
}
function Restore-PersonalApps([Context] $context) {
Restore-Git $context;
}

View file

@ -1,32 +1,12 @@
. "$PSScriptRoot/../Scripts/Context.ps1";
. "$PSScriptRoot/../Scripts/PersonalFiles.ps1";
. "$PSScriptRoot/../Software/git/Manage.ps1";
. "$PSScriptRoot/../Software/LGHub/Manage.ps1";
. "$PSScriptRoot/../Software/ManiaPlanet/Manage.ps1";
. "$PSScriptRoot/../Software/osu!/Manage.ps1";
. "$PSScriptRoot/../Software/osu!lazer/Manage.ps1";
. "$PSScriptRoot/../Software/PuTTY/Manage.ps1";
. "$PSScriptRoot/../Software/RetroArch/Manage.ps1";
. "$PSScriptRoot/../Software/reWASD/Manage.ps1";
. "$PSScriptRoot/../Software/TrackMania Nations Forever/Manage.ps1";
. "$PSScriptRoot/../Software/TrackMania United Forever/Manage.ps1";
. "$PSScriptRoot/../Software/VisualStudio/Manage.ps1";
. "$PSScriptRoot/../Collections/Personal.ps1";
function Backup-WindowsInstallation([Context] $context) {
Write-Information "Backing up Windows";
$backupRoot = $context.BackupRoot();
Backup-PersonalFiles $context;
Backup-Git $context;
Backup-LogitechGHUB $context;
Backup-ManiaPlanet $context;
Backup-Osu $context;
Backup-OsuLazer $context;
Backup-PuTTY $context;
Backup-RetroArch $context;
Backup-reWASD $context;
Backup-TmNations $context;
Backup-TmUnited $context;
Backup-VisualStudio $context;
Backup-PersonalApps $context;
$context.Backup($backupRoot, "$backupRoot.7z", @("-sdel"));
}
@ -60,7 +40,6 @@ function Restore-WindowsInstallation([Context] $context) {
}
Restore-PersonalFiles $context;
Restore-Git $context;
Restore-PersonalApps $context;
Remove-Item -Recurse $context.RootDir;
}