Skip to content

Instantly share code, notes, and snippets.

View alepouna's full-sized avatar
🦊

alepouna alepouna

🦊
View GitHub Profile
@alepouna
alepouna / DisableUSBPowerManagement.ps1
Created March 31, 2024 09:00 — 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."
$hubs = Get-WmiObject Win32_Serialport | Select-Object Name,DeviceID,Description
$powerMgmt = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi
foreach ($p in $powerMgmt)
{
$IN = $p.InstanceName.ToUpper()
someone leaked their bot token, lets hope github removes thems OTQxMDE0OTMwMTc2NDg3NDc0.YgPycg._EMQ6GITllT-vSHe11HAbqZOiro