Documentation
¶
Index ¶
Constants ¶
const TaskName = taskName
TaskName is the Windows scheduled task name. Exported so other packages (e.g. schedinfo) can query the task without re-deriving the constant.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install configures Windows Task Scheduler for periodic scanning. If already installed, upgrades by removing and re-creating the task.
func IsTaskRegistered ¶ added in v1.11.4
func IsTaskRegistered() bool
IsTaskRegistered reports whether the Windows scheduled task created by `dev-machine-guard install` is currently registered. Used by the telemetry package's invocation detector to distinguish a manual CLI run from a scheduler-triggered one. Any error or non-zero schtasks exit is treated as "not registered" so a transient Schedule-service hiccup degrades to "one_time" rather than erroring the run.
func RunNow ¶ added in v1.11.7
RunNow asks Task Scheduler to fire the registered task immediately, using its configured principal (/ru INTERACTIVE for admin installs). Used by the install flow under LocalSystem to surface first-run telemetry under the logged-in user rather than scanning SYSTEM's empty profile inline.
schtasks /run returns 0 once the scheduler has accepted the request; it does not wait for the task to complete and does not report whether an interactive session exists. If no user is logged in, the trigger silently no-ops and the task fires on its next hourly tick.
Types ¶
This section is empty.