20 lines
766 B
PowerShell
20 lines
766 B
PowerShell
#!/bin/pwsh
|
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
|
|
|
$null = New-Module {
|
|
$path = "$HOME/Documents/ManiaPlanet";
|
|
$softwareName = "ManiaPlanet";
|
|
|
|
function Backup-ManiaPlanet([Context] $context) {
|
|
Write-Information "Backing up ManiaPlanet";
|
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
|
}
|
|
|
|
function Restore-ManiaPlanet([Context] $context) {
|
|
Write-Host "Restoring ManiaPlanet";
|
|
Write-Information "Installing ManiaPlanet";
|
|
winget install --accept-source-agreements --accept-package-agreements -e --id Nadeo.ManiaPlanet;
|
|
Write-Information "Restoring files";
|
|
$context.Restore($context.SoftwareArchive($softwareName), $path);
|
|
}
|
|
}
|