Ensure time is set correctly on windows
This commit is contained in:
parent
94024951ff
commit
79cc1e3db4
1 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,16 @@
|
|||
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 {
|
||||
|
|
Loading…
Reference in a new issue