From 689dea344db04bade2834f5132de2845bbd93759 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 22 Jul 2021 12:30:21 +0800 Subject: [PATCH] [feature] script to add schedule task for wsl time sync --- win/setup/wsl-time-sync.ps1 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 win/setup/wsl-time-sync.ps1 diff --git a/win/setup/wsl-time-sync.ps1 b/win/setup/wsl-time-sync.ps1 new file mode 100644 index 0000000..f5438e7 --- /dev/null +++ b/win/setup/wsl-time-sync.ps1 @@ -0,0 +1,2 @@ +schtasks /create /tn WSLClockSync /tr "wsl.exe sudo hwclock -s" /sc onevent /ec system /mo "*[System[Provider[@Name='Microsoft-Windows-Kernel-General'] and (EventID=1)]]" +Set-ScheduledTask WSLClockSync -Settings (New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries) \ No newline at end of file