PortValhalla/scripts/Windows/Software/PuTTY/Manage.ps1

17 lines
590 B
PowerShell
Raw Normal View History

2023-06-07 19:57:00 +00:00
. "$PSScriptRoot/../../Scripts/Context.ps1";
$softwareName = "PuTTY";
$configFile = "${softwareName}.reg";
function New-TempDirectory() {
$tempDir = Join-Path $([System.IO.Path]::GetTempPath()) $([System.IO.Path]::GetRandomFileName());
$null = New-Item -ItemType Directory $tempDir;
return $tempDir;
}
function Invoke-BackupPuTTY([Context] $context) {
$tempDir = New-TempDirectory;
$fileName = Join-Path "$tempDir" $configFile;
& reg export "HKCU\Software\SimonTatham" "$fileName" /y;
$context.Backup($tempDir, $context.SoftwareArchive($softwareName), @());
}