Skip to content

Instantly share code, notes, and snippets.

@matru
matru / xperf-dpcisr.bat
Created October 1, 2025 21:47
Extract ISR/DPC execution time data with xperf
@echo off
REM --- Check for admin privileges ---
net session >nul 2>&1
if %errorlevel% neq 0 (
echo error: administrator privileges required >&2
exit /b 1
)
REM --- Check for xperf ---
@matru
matru / DisableUSBPowerManagement.ps1
Last active September 26, 2025 23:43 — forked from ThioJoe/DisableUSBPowerManagement.ps1
PowerShell script to disable Windows power management on all currently connected serial ports, including most (if not all) USB devices and adapters.
# PowerShell script to disable Windows power management on all currently connected serial ports, including USB adapters
# In simpler terms, it prevents Windows from turning off connected serial devices to save power.
# Equivalent to right-clicking on a serial port device in Device Manager > Properties > "Power Management" Tab > Unchecking "Allow the computer to turn off this device to save power."
# To run it you have a few options:
# .\SerialPowerMgmt.ps1 -Enable - this would enable power management (default)
# .\SerialPowerMgmt.ps1 -Disable - this would disable power management
# .\SerialPowerMgmt.ps1 -Disable -DryRun - just for testing, no change is done