Add script for restoring putty

This commit is contained in:
Manuel Thalmann 2023-07-02 15:16:24 +02:00
parent e416032f28
commit 8dadaa875a
2 changed files with 14 additions and 0 deletions

View file

@ -36,4 +36,5 @@ function Restore-PersonalApps([Context] $context) {
Restore-ManiaPlanet $context;
Restore-Osu $context;
Restore-OsuLazer $context;
Restore-PuTTY $context;
}

View file

@ -12,4 +12,17 @@ $null = New-Module {
$context.Backup($tempDir, $context.SoftwareArchive($softwareName), @());
Remove-Item -Recurse $tempDir;
}
function Restore-PuTTY([Context] $context) {
Write-Host "Restoring PuTTY";
Write-Information "Installing PuTTY";
choco install -y putty;
Write-Information "Restoring configuration";
$tempDir = $context.GetTempDirectory();
$fileName = Join-Path "$tempDir" $configFile;
$context.Restore($context.SoftwareArchive($softwareName), $tempDir);
& reg import "$fileName" /y;
Remove-Item -Recurse $tempDir;
}
}