Windows Operations

The windows module handles misc windows operations.

windows.reboot

Stateless operation

This operation will always execute commands and is not idempotent.

Restart the server.

windows.reboot()

windows.service

Stop/Start a Windows service.

windows.service(service, running=True, restart=False, suspend=False)
  • service: name of the service to manage
  • running: whether the the service should be running or stopped
  • restart: whether the the service should be restarted
  • suspend: whether the the service should be suspended

Example:

windows.service(
    name="Stop the spooler service",
    service="service",
    running=False,
)