Allow archives to not be split
This commit is contained in:
parent
5c1832c116
commit
21fd4093df
2 changed files with 15 additions and 4 deletions
|
@ -10,7 +10,7 @@ function Backup-WindowsInstallation([Context] $context) {
|
||||||
$backupRoot = $context.BackupRoot();
|
$backupRoot = $context.BackupRoot();
|
||||||
Backup-PersonalFiles $context;
|
Backup-PersonalFiles $context;
|
||||||
Backup-PersonalApps $context;
|
Backup-PersonalApps $context;
|
||||||
$context.Backup($backupRoot, "$backupRoot.7z");
|
$context.Backup($backupRoot, "$backupRoot.7z", @(), $false);
|
||||||
$context.Cleanup();
|
$context.Cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,6 +151,10 @@ class Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] Backup([string]$sourcePath, [string]$archivePath, [string[]]$arguments) {
|
[void] Backup([string]$sourcePath, [string]$archivePath, [string[]]$arguments) {
|
||||||
|
$this.Backup($sourcePath, $archivePath, $arguments, $true);
|
||||||
|
}
|
||||||
|
|
||||||
|
[void] Backup([string]$sourcePath, [string]$archivePath, [string[]]$arguments, [bool]$split) {
|
||||||
if (Test-Path $archivePath) {
|
if (Test-Path $archivePath) {
|
||||||
Remove-Item -Recurse $archivePath;
|
Remove-Item -Recurse $archivePath;
|
||||||
}
|
}
|
||||||
|
@ -163,16 +167,23 @@ class Context {
|
||||||
"-xr!desktop.ini",
|
"-xr!desktop.ini",
|
||||||
"-xr!thumbs.db",
|
"-xr!thumbs.db",
|
||||||
"-xr!Thumbs.db",
|
"-xr!Thumbs.db",
|
||||||
"-v3g",
|
|
||||||
"-slp",
|
"-slp",
|
||||||
#"-mx=9",
|
#"-mx=9",
|
||||||
$archivePath) + $arguments) `
|
$archivePath) + $arguments + (
|
||||||
|
if ($split) {
|
||||||
|
@("-v3g");
|
||||||
|
} else {
|
||||||
|
@();
|
||||||
|
}
|
||||||
|
)) `
|
||||||
-Wait `
|
-Wait `
|
||||||
-NoNewWindow;
|
-NoNewWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] Restore([string]$archivePath, [string]$destinationPath) {
|
[void] Restore([string]$archivePath, [string]$destinationPath) {
|
||||||
$archivePath = "$archivePath.001";
|
if (-not (Test-Path -PathType Leaf $archivePath)) {
|
||||||
|
$archivePath = "$archivePath.001";
|
||||||
|
}
|
||||||
|
|
||||||
if (-not (Test-Path -PathType Leaf $archivePath)) {
|
if (-not (Test-Path -PathType Leaf $archivePath)) {
|
||||||
Write-Information (
|
Write-Information (
|
||||||
|
|
Loading…
Reference in a new issue