PSCaffeinate

1.0.0

PSCaffeinate prevents Windows from sleeping -- a drop-in equivalent of the macOS caffeinate command. Supports all major caffeinate flags (-d, -i, -s, -u), timeout (-t), wait-for-PID (-w), and running a subprocess, using the Win32 SetThreadExecutionState API. Exports Invoke-Caffeinate with the alias caffeinate.

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSCaffeinate -RequiredVersion 1.0.0

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSCaffeinate -Version 1.0.0

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Ray Piller. MIT License.

Package Details

Author(s)

  • Ray Piller

Tags

caffeinate sleep power idle display Windows productivity SetThreadExecutionState

Functions

Invoke-Caffeinate

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

v1.0.0 - Initial release. Invoke-Caffeinate with alias caffeinate. Flags: -d (display), -i (idle), -s (system), -u (user-active). Modes: indefinite, -t timeout, -w PID, subprocess. ShouldProcess / -WhatIf support. Platform guard for non-Windows PowerShell Core.

FileList

Version History

Version Downloads Last updated
1.1.0 4 5/9/2026
1.0.0 (current version) 4 5/9/2026