Run a Windows task on system unlock
You can't do it through any of the normal scheduler commands. But if you write an XML block that includes a SessionStateChangeTrigger, like
<SessionStateChangeTrigger>
<StateChange>SessionUnlock</StateChange>
</SessionStateChangeTrigger>
Then you can pass the whole XML block to Register-ScheduledTask:
Register-ScheduledTask -Xml $xml -Force
TIL: Grabbing any corner of a Windows window and resizing it will cause the entire window to be forced onto the screen.
If you wanted to run a scheduled task on a Windows machine, would you use the Windows scheduler or a WSL Cron service? Why?
Windows Subsystem for Linux suddenly unable to run Windows apps? Somebody forgot to provide the interop directions file. Solution here:
WSL2 (Preview) cannot run .exe files: exec format error: wsl.exe · Issue #8952 · microsoft/WSL