power.shutdown

Synopsis

power.shutdown [name: value]...

Description

power.shutdown shuts down the system with shutdown. Without at and delay the action runs at once and is irreversible; the report says so before the change. With at (an instant, converted to a delay with the clock of the engine) or delay (rounded up to whole minutes on Linux and macOS) the action is scheduled and power.cancel undoes it. A second schedule while one exists is E_IN_USE on Linux. message is shown to the logged-in users.

Rights: the command accepts privilege; write privilege: elevated when the account that runs Nurt is not the administrator. A program that fails for lack of rights ends the command with E_PERMISSION, and privilege: auto repeats it once elevated. An elevated entry is undone by the same elevated process.

undo of a scheduled action runs power.cancel; an immediate action cannot be undone.

Parameters

Parameter Type Default Description
at instant none Time of the shutdown; converted to a delay with the clock of the engine.
delay duration none Time until the shutdown; rounded up to whole minutes on Linux and macOS.
message text none Message shown to the logged-in users.

Input and output

Form Input Output
default none effect

Effect

Property Value
Category change
Effect external
Reversibility reversible_if_preserved
Implementation system_program
Reversibility conditions A scheduled shutdown is undone by power.cancel; one without at or delay runs at once and is irreversible.
External use system_program: shutdown; The system is shut down with the program shutdown.

Examples

Schedule in ten minutes.

power.shutdown delay: 10m message: "Maintenance" privilege: elevated

Schedule at a time.

power.shutdown at: "2026-12-01T03:00:00Z" privilege: elevated

Run the immediate action with elevated rights; adding the call parameter preview: true shows the effect first.

power.shutdown privilege: elevated

Errors

Code Meaning Typical fix
E_IN_USE A restart or shutdown is already scheduled. Cancel it with power.cancel.
E_INVALID_VALUE at is in the past. Give a later time.
E_PERMISSION The account lacks the rights of the administrator. Add privilege: elevated.
E_EXTERNAL_MISSING The system program of the command is not installed. Install the program named in the message.
E_STAGE_FAILED The system program ended with an error. Read the end of the error output in the message.

power.cancel, power.restart, power.shutdown.

Source file on GitHub: docs/commands/power.shutdown.md