I can see many had issues with a broken power button on the Moto G5 .
As long as the finger print sensor is in use and you keep the phone charged, the phone is still useable.
But if it does shut down, here is how to get it booted again.
I was lucky in that USB debugging was already enabled...