When install Windows on a older devices, many devices could potentially wake up the computer from the sleep mode.
It's possible to identify them using the Event Viewer. But it's always a hassle.
Run the following PowerShell in terminal to disable all devices capable to wake the computer. And then identify the devices we really want to wake the computer in Device Manager, and set thier Power Management.
$wakeDevices = powercfg -devicequery wake_armed
# Disable wake for each device
foreach ($device in $wakeDevices) {
if ($device -ne "") {
Write-Host "Disabling wake for: $device"
powercfg -devicedisablewake "$device"
}
}
Write-Host "All wake-capable devices have been disabled."