PortValhalla/scripts/Windows/Software/ManiaPlanet/Install.ps1

21 lines
776 B
PowerShell
Raw Normal View History

2023-07-12 20:37:31 +00:00
#!/bin/pwsh
2024-08-07 19:05:32 +00:00
. "$PSScriptRoot/../../../Common/Scripts/Context.ps1";
2023-06-07 17:40:13 +00:00
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) {
Write-Information "Backing up ManiaPlanet";
2023-06-08 00:28:33 +00:00
$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);
}
2023-06-07 17:40:13 +00:00
}