31 lines
936 B
PowerShell
31 lines
936 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();
|
|
Invoke-WindowsInstallation $context;
|
|
Restart-Computer -Force;
|