2023-07-12 20:37:31 +00:00
|
|
|
#!/bin/pwsh
|
2023-06-07 17:40:13 +00:00
|
|
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
|
|
|
|
2023-06-08 00:28:33 +00:00
|
|
|
$null = New-Module {
|
|
|
|
$path = "$HOME/Documents/ManiaPlanet";
|
|
|
|
$softwareName = "ManiaPlanet";
|
|
|
|
|
2023-06-30 10:19:54 +00:00
|
|
|
function Backup-ManiaPlanet([Context] $context) {
|
2023-06-30 12:23:20 +00:00
|
|
|
Write-Information "Backing up ManiaPlanet";
|
2023-06-08 00:28:33 +00:00
|
|
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
|
|
|
}
|
2023-07-02 12:00:33 +00:00
|
|
|
|
|
|
|
function Restore-ManiaPlanet([Context] $context) {
|
|
|
|
Write-Host "Restoring ManiaPlanet";
|
|
|
|
Write-Information "Installing ManiaPlanet";
|
2023-07-02 15:55:42 +00:00
|
|
|
winget install --accept-source-agreements --accept-package-agreements -e --id Nadeo.ManiaPlanet;
|
2023-07-02 12:00:33 +00:00
|
|
|
Write-Information "Restoring files";
|
|
|
|
$context.Restore($context.SoftwareArchive($softwareName), $path);
|
|
|
|
}
|
2023-06-07 17:40:13 +00:00
|
|
|
}
|