To keep a machine awake forever, turning off all power saving/sleep settings, just paste this into command line.

powercfg /change monitor-timeout-ac 0 & powercfg /change monitor-timeout-dc 0 & powercfg /change standby-timeout-ac 0 & powercfg /change standby-timeout-dc 0 & powercfg /change hibernate-timeout-ac 0 & powercfg /change hibernate-timeout-dc 0

Tested in powershell, doesn’t work

Tested/verified working on windows 11, both local command line, and atera remote command line. 

Or just download and run caffeine