2023-06-07 20:56:41 +00:00
|
|
|
. "$PSScriptRoot/Context.ps1";
|
2023-06-06 22:56:29 +00:00
|
|
|
|
|
|
|
function Get-BackupCandidates() {
|
|
|
|
[System.Collections.Generic.List[System.Tuple[string, string, string[]]]]$candidates = @();
|
|
|
|
|
|
|
|
$candidates.AddRange(
|
|
|
|
[System.Tuple[string, string, string[]][]]@(
|
|
|
|
[System.Tuple]::Create("Home", "$HOME", @("-i@`"$PSScriptRoot/FileLists/Home.include.txt`"", "-x@`"$PSScriptRoot/FileLists/Home.exclude.txt`"")),
|
|
|
|
[System.Tuple]::Create("Public", "$env:PUBLIC", @("-i@`"$PSScriptRoot/FileLists/Public.include.txt`"", "-x@`"$PSScriptRoot/FileLists/Public.exclude.txt`""))));
|
|
|
|
|
|
|
|
return $candidates;
|
|
|
|
}
|
|
|
|
|
|
|
|
function Invoke-FileBackup([Context] $context) {
|
|
|
|
foreach ($candidate in Get-BackupCandidates) {
|
2023-06-06 23:32:14 +00:00
|
|
|
$context.Backup($candidate[1], $context.FileArchivePath($candidate[0]), $candidate[2]);
|
2023-06-06 22:56:29 +00:00
|
|
|
}
|
|
|
|
}
|