PortValhalla/profiles/DerGeret/Windows/Restore.ps1

30 lines
901 B
PowerShell
Raw Normal View History

2023-07-12 20:37:31 +00:00
#!/bin/pwsh
2023-07-14 07:24:13 +00:00
. "$PSScriptRoot/Drivers.ps1";
. "$PSScriptRoot/../../../scripts/Windows/Collections/Personal.ps1"
. "$PSScriptRoot/../../../scripts/Windows/OS/Install.ps1";
. "$PSScriptRoot/../../../scripts/Windows/Scripts/Context.ps1";
2023-08-13 23:32:57 +00:00
function Initialize-Configuration {
2024-03-23 15:00:41 +00:00
# Fix synchronization between Linux and Windows clock
2023-08-13 23:32:57 +00:00
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;
}
2023-08-13 23:32:57 +00:00
}
function Restore-Apps {
param([Context] $context)
Restore-PersonalApps $context;
}
2023-06-22 15:59:10 +00:00
Write-Host "Starting Restoration of Windows";
[Context]$context = [Context]::new();
Start-WindowsInstallation;