Skip to content

Instantly share code, notes, and snippets.

@mzernetsch
mzernetsch / start-sleep-on-no-input-devices.ps1
Created November 9, 2025 19:18
Monitors HID devices and puts system to sleep when all devices are disconnected.
<#
.SYNOPSIS
Monitors HID devices and puts system to sleep when all devices are disconnected.
.DESCRIPTION
This script monitors the connection and disconnection of HID (Human Interface Device) class devices.
When all HID devices are disconnected, it automatically puts the system into sleep mode.
The script can also be installed as a startup task using the -Install parameter.
.PARAMETER Install
@mzernetsch
mzernetsch / start-sleep-on-http.ps1
Created November 9, 2025 14:26
Simple PowerShell HTTP listener to sleep/shutdown/restart a Windows PC using HTTP requests
<#
.SYNOPSIS
A PowerShell HTTP listener that handles system power management requests.
.DESCRIPTION
This script creates an HTTP listener that can control system sleep, restart and shutdown states.
It requires initial installation with admin rights, after which it runs automatically on system startup.
.PARAMETER Install
@mzernetsch
mzernetsch / enable-wob.reg
Created November 9, 2025 12:34
Enable wake-on-bluetooth in windows registry
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters]
"SystemRemoteWakeSupported"=dword:00000001