Is there a way to set system time from my app running on a Raspberry Pi 2 in Windows 10 IoT Core Insider Preview?
This doesn\'t work for lack of kernel32.dll
<
You can call any PowerShell routine from C# on UWP/IoT-Core systems. As such, the PowerShell commands are always available in/to your App.
For an example, see the ProcessLauncher sample on GitHub.
Run PowerShell as an Administrator on the board (Press the Windows button, and start typing PowerShell, right click on the icon and select “Run as Administrator”).
Set-ExecutionPolicy RemoteSigned
PuTTy to RPi as admin and:
setx PATH "%PATH%;C:\Windows\System32"
schtasks /create /tn "StartupPowerShell" /tr c:\Startup.bat /sc onstart /ru SYSTEM
powershell -command "C:\IotCoreStartup.ps1"
$logFile = 'C:\StartupLog.txt'
get-date > $logFile
tzutil /s "UTC" >> $logFile
# set alternate time servers
"Setting additional time servers" >> $logFile
w32tm /config /syncfromflags:manual /manualpeerlist:"0.windows.time.com 1.pool.ntp.org" >> $logFile
schtasks /Delete /TN "StartupPowerShell"
schtasks /Run /tn "StartupPowerShell"