2024-08-08 02:36:35 +00:00
|
|
|
using namespace Microsoft.Win32;
|
|
|
|
|
2024-08-28 11:00:37 +00:00
|
|
|
. "$PSScriptRoot/../../Scripts/Restoration.ps1";
|
2024-09-23 01:33:17 +00:00
|
|
|
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
|
2024-08-08 22:17:05 +00:00
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
2024-08-28 11:00:37 +00:00
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-09-30 03:00:20 +00:00
|
|
|
Start-SoftwareInstaller @args `
|
2024-08-08 02:36:35 +00:00
|
|
|
-Installer {
|
|
|
|
Install-ChocoPackage putty;
|
2024-08-28 11:00:37 +00:00
|
|
|
} `
|
|
|
|
-UserBackup {
|
2024-09-23 00:10:42 +00:00
|
|
|
param(
|
|
|
|
[string] $Name,
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
2024-08-28 11:00:37 +00:00
|
|
|
$dir = New-TemporaryDirectory;
|
|
|
|
$fileName = Join-Path "$dir" PuTTY.reg;
|
|
|
|
& reg export "HKCU\Software\SimonTatham\PuTTY" $fileName /y;
|
2024-09-23 00:10:42 +00:00
|
|
|
Add-BackupArtifacts -User $Arguments.Name -Source $fileName -Path "$Name/$Name.reg";
|
2024-08-28 11:00:37 +00:00
|
|
|
Remove-Item -Recurse -Force $dir;
|
|
|
|
} `
|
|
|
|
-UserConfigurator {
|
2024-09-23 00:10:42 +00:00
|
|
|
param(
|
|
|
|
[string] $Name,
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
2024-08-28 11:00:37 +00:00
|
|
|
$dir = New-TemporaryDirectory;
|
|
|
|
$fileName = Join-Path "$dir" PuTTY.reg;
|
2024-09-23 00:10:42 +00:00
|
|
|
Expand-BackupArtifacts -User $Arguments.Name -Path "$Name/$Name.reg" -Target $fileName;
|
2024-08-28 11:00:37 +00:00
|
|
|
& reg import $fileName;
|
|
|
|
Remove-Item -Recurse -Force $dir;
|
2024-08-08 02:36:35 +00:00
|
|
|
};
|