PortValhalla/profiles/DerGeret/Windows/Restore.ps1

30 lines
901 B
PowerShell

#!/bin/pwsh
. "$PSScriptRoot/Drivers.ps1";
. "$PSScriptRoot/../../../scripts/Windows/Collections/Personal.ps1"
. "$PSScriptRoot/../../../scripts/Windows/OS/Install.ps1";
. "$PSScriptRoot/../../../scripts/Windows/Scripts/Context.ps1";
function Initialize-Configuration {
# Fix synchronization between Linux and Windows clock
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Value 1 -Type "DWord";
# Force time resynchronization
$service = Get-Service W32Time;
$stopped = ($service.Status -eq "Stopped");
Start-Service $service;
w32tm /resync /force;
if ($stopped) {
Stop-Service $service;
}
}
function Restore-Apps {
param([Context] $context)
Restore-PersonalApps $context;
}
Write-Host "Starting Restoration of Windows";
[Context]$context = [Context]::new();
Start-WindowsInstallation;